VBC09363 — Expected variable or procedure, not module
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
The name of a standard module is used by itself, as a value or a procedure.
A standard module's name qualifies the names of its members (Globals.Counter): by itself it is no variable, no value and no procedure.
MS-VBA reports the same error, with the same message (recorded in Excel), for a module of your project and for a module of a library, such as
Strings or VBA.Strings. A project is VBC09376 instead, and an enumeration VBC09377.
This code is raised where a name is resolved, bare or qualified.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
| A module assigned to a variable. | x = Globals, x = VBA.Strings |
Name the member of the module: x = Globals.Counter. |
| A module called. | Call Globals, Strings |
Name the procedure of the module: Call Globals.Reset. |
| A module as the target of an assignment. | Strings = 1, Set Globals = Nothing |
Assign to a variable of the module: Globals.Counter = 1. |
Where an operator, a Set statement's value, Len, a With block or a For Each loop has a module as its operand, the error is the one that place
reports: a Type mismatch, Variable required, VBC09378, or VBC09379.
See also
⏮️ VBC09362 Type mismatch: array or user-defined type expected | ⏭️ VBC09364 Expected Sub, Function, or Property
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca