RDCore Diagnostics
Every problem the RDCore platform reports carries a stable code and, through the LSP
codeDescription field, a link to its page here. See
RD-VBAL §2.6 Diagnostics for the definition of each code
family, and RD-VBAL §2.6.5 Diagnostics Pipeline
for the pull pipeline.
| Family | Prefix | Raised by |
|---|---|---|
| Syntax errors | VBC (VBC00001–VBC00999) |
the parser, walking the concrete syntax tree |
| Semantic compilation errors | VBC (VBC09300+) |
the static semantics layer, walking the abstract syntax tree |
| Runtime errors | VBR / VBA |
the runtime semantics layer (VBR) / a workspace Err.Raise (VBA) |
| Rubberduck Core diagnostics | RDC |
the RDCore.Diagnostics analyzers |
Stability
A code has a page here as soon as the platform can emit it.
Once published, a code is not renumbered and not retired: a workspace built against an older release must still resolve its diagnostic links. The content of a page may evolve as the ideal set of codes is narrowed down; the code and its abstract meaning do not.
Each page describes the condition in the abstract. The specifics of a particular occurrence (which token, which literal, which type) are carried in the diagnostic's verbose detail, not in the code.
Published codes
Syntax errors
| Code | Condition |
|---|---|
| VBC00001 | Syntax error — a token the grammar cannot place |
| VBC00042 | Numeric literal overflow — a literal outside the range of its type |
| VBC00043 | Next without For — a Next statement ends no For loop |
| VBC00044 | For without Next — a For loop is not ended before its procedure is |
| VBC00045 | Loop without Do — a Loop statement ends no Do loop |
| VBC00046 | Do without Loop — a Do loop is not ended before its procedure is |
| VBC00047 | End If without block If — an End If statement ends no block If |
| VBC00048 | Block If without End If — a block If is not ended before its procedure is |
| VBC00049 | Else without If — an Else statement belongs to no block If |
| VBC00050 | Case without Select Case — a Case clause belongs to no Select Case statement |
| VBC00051 | Select Case without End Select — a Select Case statement is not ended before its procedure is |
| VBC00052 | End With without With — an End With statement ends no With block |
| VBC00053 | Expected End With — a With block is not ended before its procedure is |
| VBC00054 | Invalid outside procedure — a statement that runs is written in the declarations section of a module |
| VBC00055 | Only comments may appear after End Sub, End Function, or End Property — a declaration or a statement is written after the first procedure of a module |
Semantic compilation errors
| Code | Condition |
|---|---|
| VBC09301 | Ambiguous name detected — an identifier names more than one declaration at one level of scope |
| VBC09302 | Variable not defined — a name is used that no declaration defines, under Option Explicit |
| VBC09303 | Duplicate declaration in current scope — a name is declared more than once at one level of scope |
| VBC09304 | Invalid use of object — an object is used where a value of another kind is required |
| VBC09305 | Invalid ParamArray use — a ParamArray passed to a ByRef parameter of your own code |
| VBC09306 | Invalid ReDim — a ReDim re-dimensions a member of an object declared As Object |
| VBC09307 | Expected array — LBound or UBound is asked the bounds of a variable that can never hold an array |
| VBC09309 | Label not defined — a jump names a line label or line number the procedure does not define |
| VBC09310 | Type mismatch — a value is of a type that cannot be let-coerced to the type it is used as |
| VBC09311 | User-defined type not defined — a declared type is a name that does not resolve to a type |
| VBC09312 | Exit Do not within Do...Loop — an Exit Do that is not inside a Do loop |
| VBC09313 | Exit For not within For...Next — an Exit For that is not inside a For or For Each loop |
| VBC09314 | Exit Function not allowed in Sub or Property — an Exit Function in a Sub, or a Property Let or Set |
| VBC09315 | Exit Property not allowed in Sub or Function — an Exit Property in a Sub or a Function |
| VBC09316 | Method or data member not found — a member is accessed on a type known not to have it |
| VBC09317 | Invalid use of Me — Me is written where there is no object it could be |
| VBC09318 | With expression outside With block — a leading-dot member has no enclosing With block |
| VBC09319 | Duplicate label definition — a procedure defines the same line label or line number more than once |
| VBC09320 | Inconsistent property accessors — a property's Get/Let/Set do not together describe one valid property |
| VBC09321 | Argument required for Property Let or Property Set — a Let/Set declares no parameters at all |
| VBC09322 | Event not defined — a RaiseEvent names an event the class module does not declare |
| VBC09323 | Wrong number of arguments or invalid argument for event — a RaiseEvent's arguments do not match the event's parameters |
| VBC09324 | Invalid type for WithEvents variable — not a specific class with events, or the class of its own module |
| VBC09325 | Invalid event name — an Event declaration whose name has an underscore |
| VBC09326 | Invalid event handler — a procedure named for an event is not a subroutine with a compatible parameter list |
| VBC09327 | ByVal argument not allowed here — no longer raised: a ByVal argument is the error MS-VBA reports (RD-VBAL §5.6.13.1) |
| VBC09328 | Invalid Implements directive — the class itself, a repeat, an underscore in a public member, or overlapping interface prefixes |
| VBC09329 | Object module needs to implement all members of its interface — a public member of the interface has no implemented name declaration |
| VBC09330 | Invalid implemented member — an implemented name declaration of another kind, parameters or type than its member |
| VBC09331 | Sub or Function not defined — a statement or a call the language the code is written in does not have |
| VBC09332 | Exit Sub not allowed in Function or Property — an Exit Sub in a Function or a property |
| VBC09333 | Variable required — an expression that is not a variable is where a statement requires one |
| VBC09334 | Access not valid for the file mode — the Access clause of an Open is not one its For mode allows |
| VBC09335 | Type-declaration character does not match declared data type — a name is written with the character of a type other than the one it was declared as |
| VBC09336 | Private Enum and user defined types cannot be used in public members — a public member is declared with a private Enum, or in a class with a private type |
| VBC09337 | Not allowed as a Public member of an object module — a class exposes a constant, fixed-length string, array, user-defined type or Declare |
| VBC09338 | Cannot define a Public user-defined type within an object module — a class module declares a public Type |
| VBC09339 | Argument not optional — an object whose default member takes an argument is where a value is expected |
| VBC09340 | Expected Function or variable — a subroutine is used where a value is expected |
| VBC09341 | Can't assign to read-only property — a property that can only be read is assigned with Let |
| VBC09342 | Wrong number of arguments or invalid property assignment — a procedure is called with arguments it does not declare |
| VBC09343 | LSet allowed only on strings and user-defined types — the target of an LSet statement is neither a String nor a user-defined type |
| VBC09344 | RSet allowed only on strings — the target of an RSet statement is not a String |
| VBC09345 | Invalid use of property — a property that can only be read is assigned with Set |
| VBC09346 | Assignment to constant not permitted — a constant is assigned |
| VBC09347 | Object required — a Set statement assigns to a variable that cannot hold an object |
| VBC09348 | Named argument already specified — a call gives the same parameter two arguments |
| VBC09349 | Named argument not found — a call names a parameter the procedure does not declare |
| VBC09350 | Constant expression required — the value of a constant reads something that has no value until the code runs |
| VBC09351 | Invalid data type for constant — the value of a constant is an object |
| VBC09352 | Overflow — the value of a constant does not fit its type |
| VBC09353 | Division by zero — the value of a constant divides by zero |
| VBC09354 | Invalid qualifier — a member is accessed on a value that has no members |
| VBC09355 | Function call on left-hand side of assignment must return Variant or Object — a call of a function is assigned |
| VBC09356 | Wrong number of dimensions — an element of an array is selected by the wrong number of subscripts |
| VBC09357 | Array already dimensioned — an array declared with fixed dimensions is given others |
| VBC09358 | For control variable already in use — a loop is controlled by the variable of a loop it is nested in |
| VBC09359 | Invalid Next control variable reference — a Next statement names a variable that is not the control variable of its loop |
| VBC09360 | Can't assign to array — an array declared with fixed dimensions is assigned an array |
| VBC09361 | ByRef argument type mismatch — a variable is passed to a ByRef parameter of another type |
| VBC09362 | Type mismatch: array or user-defined type expected — an array is passed to a parameter declared as an array of another type |
| VBC09363 | Expected variable or procedure, not module — the name of a standard module is used by itself, as a value or a procedure |
| VBC09364 | Expected Sub, Function, or Property — a call statement names a variable or a constant of the procedure, not a procedure |
| VBC09365 | Range has no values — an array is declared with an upper bound less than its lower bound |
| VBC09366 | A module is not a valid type — a declaration is typed with the name of a standard module |
| VBC09367 | Invalid use of AddressOf operator — an AddressOf expression names a method of a class module, or of an object |
| VBC09368 | Invalid use of New keyword — a variable is declared As New of a type that is no class, of a library's class that cannot be created, or WithEvents |
| VBC09369 | Can't change data types of array elements — a ReDim gives an array elements of another type than it is declared with |
| VBC09370 | Expected procedure, not variable — a call statement names a variable or a constant of a module, not a procedure |
| VBC09371 | Array argument must be ByRef — an argument of an array parameter is written ByVal |
| VBC09372 | Member already exists in an object module from which this object module derives — the code of a form declares something with the name of one of its controls |
| VBC09373 | Automation type not supported in Visual Basic — a type is written with the name of a library's module, Strings |
| VBC09374 | Expected user-defined type, not project — a type is written with the name of a project or a library, VBA |
| VBC09375 | Invalid length for fixed-length string — a String * n is declared with a length under 1 or past 65526 |
| VBC09376 | Expected variable or procedure, not project — a project, VBA, is written where a value is |
| VBC09377 | Expected variable or procedure, not enum type — an enumeration, Color, is written where a value is |
| VBC09378 | With object must be user-defined type, Object, or Variant — a With block is about a value that has no members |
| VBC09379 | For Each may only iterate over a collection object or an array — a For Each loop iterates a value that has no elements |
Runtime errors
| Code | Condition |
|---|---|
| VBR-0001 | Application-defined or object-defined error — an error is raised with a number that has no message of its own, or by a member that cannot answer |
| VBR00003 | Return without GoSub — a Return runs with no GoSub to return to |
| VBR00005 | Invalid procedure call or argument — an argument is outside what a procedure accepts |
| VBR00006 | Overflow — a result does not fit the type it is computed in or assigned to |
| VBR00007 | Out of memory — the session's memory cannot hold an allocation |
| VBR00009 | Subscript out of range — an index is outside the bounds of an array, or a collection has no such item |
| VBR00010 | This array is fixed or temporarily locked — an array that is fixed-size or locked is resized or erased |
| VBR00011 | Division by zero — a divisor is zero |
| VBR00013 | Type mismatch — a value cannot be coerced to the type that is required |
| VBR00014 | Out of string space — a string would be longer than the platform allows |
| VBR00016 | Expression too complex — an expression is nested too deeply to evaluate |
| VBR00017 | Can't perform requested operation — an operation is not possible in the state the session is in |
| VBR00018 | User interrupt occurred — the program is interrupted |
| VBR00020 | Resume without error — a Resume runs with no error to resume from |
| VBR00028 | Out of stack space — the call stack is full |
| VBR00035 | Sub or Function not defined — a call names a procedure that is not defined |
| VBR00047 | Too many DLL application clients — a Declared library has more clients than it supports |
| VBR00048 | Error in loading DLL — a library named by a Declare cannot be loaded |
| VBR00049 | Bad DLL calling convention — a Declared procedure is called with a convention it does not have |
| VBR00051 | Internal error — the interpreter has no implementation for what the program does. This is a gap in the platform, not an error of the program |
| VBR00052 | Bad file name or number — a file number is not valid, or is not open |
| VBR00053 | File not found — a file that is to be read or deleted does not exist |
| VBR00054 | Bad file mode — an operation is not valid for the mode a file was opened in |
| VBR00055 | File already open — a file is already open, or the file number is in use |
| VBR00057 | Device I/O error — the device reported an input or output failure |
| VBR00058 | File already exists — a file that is to be created already exists |
| VBR00059 | Bad record length — a record is not the length the file was opened with |
| VBR00061 | Disk full — there is no room left on the disk |
| VBR00062 | Input past end of file — a read goes past the end of the file |
| VBR00063 | Bad record number — a record number is not valid |
| VBR00067 | Too many files — there are no file numbers left |
| VBR00068 | Device unavailable — the device is not available |
| VBR00070 | Permission denied — access to a file or record is refused |
| VBR00071 | Disk not ready — the drive is not ready |
| VBR00074 | Can't rename with different drive — a file is renamed onto a different drive |
| VBR00075 | Path/File access error — a path or file cannot be accessed as asked |
| VBR00076 | Path not found — a path does not exist |
| VBR00091 | Object variable or With block variable not set — an object is used that is not set to anything |
| VBR00092 | For loop not initialized — a loop is run from the middle, or a For Each array was never dimensioned |
| VBR00093 | Invalid pattern string — a Like pattern is not valid |
| VBR00094 | Invalid use of Null — Null is used where it is not allowed. |
| VBR00096 | Unable to sink events of object because the object is already firing events to the maximum number of event receivers that it supports — an object fires events to more receivers than it supports |
| VBR00097 | Can not call friend function on object which is not an instance of defining class — a Friend member is called on an object that is not an instance of the class that defines it |
| VBR00098 | A property or method call cannot include a reference to a private object, either as an argument or as a return value — a public call includes a reference to a private object |
| VBR00321 | Invalid file format — a file's format is not valid |
| VBR00322 | Can't create necessary temporary file — a temporary file the operation needs cannot be created |
| VBR00325 | Invalid format in resource file — a resource file's format is not valid |
| VBR00361 | Can't load or unload this object — Load or Unload is given an object that is no form |
| VBR00380 | Invalid property value — a property is given a value it does not accept |
| VBR00381 | Invalid property array index — a property array index is not valid |
| VBR00382 | Set not supported at runtime — a property cannot be set at run time |
| VBR00383 | Set not supported (read-only property) — a property is read-only |
| VBR00385 | Need property array index — a property array needs an index |
| VBR00387 | Set not permitted — setting this property is not permitted |
| VBR00393 | Get not supported at runtime — a property cannot be read at run time |
| VBR00394 | Get not supported (write-only property) — a property is write-only |
| VBR00422 | Property not found — a property is not found |
| VBR00423 | Property or method not found — a property or method is not found |
| VBR00424 | Object required — an object is required where a value is given |
| VBR00429 | ActiveX component can't create object — an ActiveX component cannot create the object |
| VBR00430 | Class does not support Automation or does not support expected interface — a class does not support Automation or the interface expected |
| VBR00432 | File name or class name not found during Automation operation — a file or class name is not found during an Automation operation |
| VBR00438 | Object doesn't support this property or method — an object does not have the property or method |
| VBR00440 | Automation error — an Automation operation failed |
| VBR00442 | Connection to type library or object library for remote process has been lost. Press OK for dialog to remove reference. — the connection to a type library or object library is lost |
| VBR00443 | Automation object does not have a default value — an Automation object has no default value |
| VBR00444 | Method not applicable in this context — a form's Controls.Remove is given a control its designer declared |
| VBR00445 | Object doesn't support this action — an object does not support the action |
| VBR00446 | Object doesn't support named arguments — an object does not support named arguments |
| VBR00447 | Object doesn't support current locale setting — an object does not support the current locale setting |
| VBR00448 | Named argument not found — a named argument is not found |
| VBR00449 | Argument not optional — a required argument is not given |
| VBR00450 | Wrong number of arguments or invalid property assignment — the number of arguments is wrong, or a property assignment is invalid |
| VBR00451 | Property let procedure not defined and property get procedure did not return an object — a Property Let is not defined and the Property Get did not return an object |
| VBR00452 | Invalid ordinal — an ordinal is not valid |
| VBR00453 | Specified DLL function not found — a function named by a Declare is not found in the library |
| VBR00454 | Code resource not found — a code resource is not found |
| VBR00455 | Code resource lock error — a code resource cannot be locked |
| VBR00457 | This key is already associated with an element of this collection — a key is already used by an element of the collection |
| VBR00458 | Variable uses an Automation type not supported in Visual Basic — a variable uses an Automation type that Visual Basic does not support |
| VBR00459 | Object or class does not support the set of events. — an object or class does not support the set of events |
| VBR00460 | Invalid clipboard format — a clipboard format is not valid |
| VBR00461 | Method or data member not found — a method or data member is not found |
| VBR00462 | The remote machine does not exist or is unavailable — the remote server machine does not exist or is unavailable |
| VBR00463 | Class not registered on local machine — a class is not registered on the local machine |
| VBR00481 | Invalid picture — a picture is not valid |
| VBR00482 | Printer error — a printer error occurred |
| VBR00735 | Can't save file to TEMP — a file cannot be saved to the temporary directory |
| VBR00744 | Search text not found — the text searched for is not found |
| VBR00746 | Replacements too long — the replacement text is too long |
Rubberduck Core diagnostics
| Code | Condition |
|---|---|
| RDC00101 | Implicit declarations enabled — a module that does not state Option Explicit |
| RDC00102 | Implicit non-default array base — a module that states Option Base 1 |
| RDC00103 | Implicit type declarations enabled — a Def<Type> directive |
| RDC00104 | Implicit ByRef modifier — a parameter that states neither ByRef nor ByVal |
| RDC00105 | Implicit Public member — a member that states no access modifier |
| RDC00106 | Implicit Variant declaration — a variable or parameter declared without a type |
| RDC00107 | Implicit Variant return type — a function declared without a return type |
| RDC00112 | Implicit narrowing conversion — a value converted implicitly into a type that holds less of it |
| RDC00114 | Implicit array declaration — a ReDim that declares the array it re-dimensions |
| RDC00115 | Implicit result local — a function that reads its own return value, as the local variable it implicitly is |
| RDC00201 | Integer data type declaration — an As Integer clause |
| RDC00202 | Module-scope Dim declaration — a module-level variable declared with Dim |
| RDC00203 | Multiline parameter declaration — one parameter declared over several lines |
| RDC00204 | Multiple declarations — a statement that declares several names |
| RDC00205 | Misleading ByRef parameter — ByRef on the value parameter of a property Let or Set |
| RDC00206 | Not all code paths return a value — a function or property getter with a code path that does not assign its return value |
| RDC00207 | IsMissing that is always False — IsMissing of a parameter that is not a Variant, or an Optional Variant with a default value |
| RDC00208 | Shadowed declaration — a local or a parameter named like a member of the module, of another module, or of a library |
| RDC00302 | Obsolete Call statement — a call statement written with the Call keyword |
| RDC00303 | Obsolete comment syntax — a comment written with the Rem keyword |
| RDC00304 | Obsolete error syntax — an Error statement |
| RDC00305 | Obsolete Global modifier — a declaration with the Global modifier |
| RDC00306 | Obsolete Let statement — an assignment written with the Let keyword |
| RDC00307 | Obsolete type hint — a name written with a type-declaration character |
| RDC00308 | Obsolete While…Wend — a loop written While…Wend |
| RDC00309 | Obsolete On Local Error statement — an error handler set with On Local Error |
| RDC00310 | Redundant ByVal argument — an argument written ByVal for a parameter that is ByVal already |
| RDC00311 | Early binding opportunity — CreateObject of a class that a referenced library declares |
| RDC00405 | Implementations should be private — a Public implementation of an interface member or handler of an event |
| RDC00407 | Unmatched event handler — a handler of a form control's event that does not match the event, and that nothing calls |
| RDC01001 | Use meaningful identifier names — a name too short, ending with a digit, or without a vowel |
| RDC01002 | Hungarian notation — a name that begins with a prefix that states its type |
| RDC11005 | Bitwise operator — a logical operator given numbers, which works on their bits |
| RDC11006 | Ambiguous concatenation — two String values joined with + |
| RDC11011 | Variant number compared with a Variant String — the number is less, whatever the values |
| RDC11012 | Set of a call that always fails — a function whose default member has no Property Set, as the target of a Set |
| RDC11013 | Variant compared with a String as text — MS-VBA compares their text, where MS-VBAL specifies a type mismatch |
| RDC11014 | Case Is compared in the selector's type — MS-VBA converts the value first, where MS-VBAL states the comparison as an expression |
| RDC11015 | Object with no default member used as a value — MS-VBA raises 438 (91 for Nothing), where MS-VBAL specifies a compile error |
| RDC11016 | Empty or Null assigned to an array — compiles, and raises a type mismatch whenever it runs |
| RDC11017 | Like pattern MS-VBA matches otherwise than specified — a [], a [!], or an invalid list |
| RDC11018 | Integer arithmetic of Abs, Int or Fix that can overflow — MS-VBA types the call as its argument, where MS-VBAL declares a Variant |
| RDC11019 | Type character ignored on a function of the library — Len$, CVar$: MS-VBAL makes the name invalid, MS-VBA ignores the character |
| RDC11020 | Variant String that is no number, compared with a number — MS-VBA ranks the String above it, where MS-VBAL specifies a type mismatch |
| RDC11021 | Constant of a procedure valued with Len — MS-VBA accepts it there, and refuses it in a module |
| RDC11022 | ReDim of a variable declared implicitly — the specification and VB6 re-dimension it, MS-VBA refuses it (Invalid ReDim) |
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca