VBC09302 — Variable not defined
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
A name is used that no declaration defines, in a module that states Option Explicit.
Without Option Explicit an undeclared name declares a variable where it is used (MS-VBAL §5.6.10); with it, it is this error. MS-VBA reports the same error: Variable not defined.
This code is raised by SimpleNameExpressionStaticSemantics.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
| A name is used that is declared nowhere. | Option Explicit ... Total = 1 with no Dim Total |
Declare it, or correct the spelling. |
See also
⏮️ VBC09301 Ambiguous name detected | ⏭️ VBC09303 Duplicate declaration in current scope
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca