Table of Contents

Enum VBCompileErrorId

Namespace
RDCore.SDK.Model.Errors
Assembly
RDCore.SDK.dll

Formally encodes a range of integer values for all VBSyntaxErrorInfo and VBCompileErrorInfo errors.

public enum VBCompileErrorId

Fields

AmbiguousName = 9301

An identifier conflicts with another identifier or requires qualification.
learn.microsoft.com

DuplicateDeclaration = 9303

The specified name is already used at this level of scope.
learn.microsoft.com

ExitDoNotWithinDoLoop = 9312

Exit Do is only valid within a Do...Loop statement.
learn.microsoft.com

ExitForNotWithinForNext = 9313

Exit For is only valid with a For...Next statement.
learn.microsoft.com

ExitFunctionNotAllowedInSubOrProperty = 9314

Exit statement must match the kind of procedure in which it occurs.
learn.microsoft.com

👉 Here "Property" must be read as Property Let or Property Set, because in MS-VBA Exit Function can legally exist inside a Property Get procedure (VBIDE accepts and corrects it)

ExitPropertyNotAllowedInSubOrFunction = 9315

Exit statement must match the kind of procedure in which it occurs.
learn.microsoft.com

ExpectedArray = 9307

A variable name with a subscript indicates the variale is a VBArrayValue.
learn.microsoft.com

ExpectedIdentifier = 9308

Syntax specifies an identifier name in this context, but none was supplied.

ℹ️ Unable to find an official learn.microsoft.com documentation link for this error.

ForbiddenWithOptionStrict = 8000

An Option Strict directive or annotation is enforcing stricter semantics that block a number of semantic flags at compile-time:

ℹ️ This is a specified error code, not (yet) a language feature.
The VB.NET Option Strict statement (RD-VBA: "directive") is documented as follows:
🎯 Restricts implicit data type conversions to only widening conversions, disallows late binding, and disallows implicit typing that results in an Object type.
learn.microsoft.com

InvalidParamArrayUse = 9305

The parameter defined as a ParamArray is used incorrectly in the procedure.
learn.microsoft.com

InvalidReDim = 9306

Not every VBArrayValue can be redimensioned.
learn.microsoft.com

InvalidUseOfObject = 9304

You tried to use an object in an incorrect way.
learn.microsoft.com

LabelNotDefined = 9309

A line label or line number is referred to (for example in a GoTo statement), but doesn't occur within the scope of the reference.
learn.microsoft.com

MethodOrDataMemberNotFound = 9316

The collection, object, or user-defined type (UDT) doesn't contain the referenced member.
learn.microsoft.com

ℹ️ The learn.microsoft.com documentation documents this error as both a compile-time and a MethodOrDataMemberNotFound error.
This works only because the documentation includes run-time collection item retrieval - otherwise this error would be purely about a failed member binding.

SyntaxError = 1

A generic "Syntax error" compile-time error.
learn.microsoft.com

👉 RDCore.Parsing should be giving us much more detailed syntax errors that this.

TypeMismatch = 9310

The variable or property is of a data type that cannot be let-coerced (implicitly converted) to the specified destination type.
learn.microsoft.com

ℹ️ The learn.microsoft.com documentation documents this error as both a compile-time and a TypeMismatch error. Since both compile-time and run-time semantics are closely related, this does make sense.

UnspecifiedCompileError = 0

A fallback error ID for a compilation error.

⚠️ This value may not reliably be interpreted as a valid compilation error ID.

UserDefinedTypeNotDefined = 9311

The data type of a variable or parameter declaration is of an unknown, inaccessible, or otherwise invalid data type.
learn.microsoft.com

👉 This error usually has absolutely nothing to do with any user-defined type (UDT) declaration. The term "user-defined" here seems to be rather standing for workspace-defined.

VariableNotDefined = 9302

You use the Option Explicit directive to protect your modules from having undeclared variables and to eliminate the possibility of inadvertently creating new variables when typographical errors occur.
learn.microsoft.com

Remarks

👉 The members of this enum are divided into sections.

  • 0 to 1: Generic system or fallback defaults.
  • 2 to 41: Reserved
  • 42 to 999: Reserved for RD-VBA formalized syntax errors (VBSyntaxErrorInfo).
  • 1000 to 7999: Reserved
  • 8000 to 9299: Reserved for future RD-VBA extensibility.
  • 9300+: Formalized MS-VBA compilation errors. This list is currently vastly incomplete.

ℹ️ 93 is for 1993, the year MS-VBA came into existence.