VBC09370 — Expected procedure, not variable
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
A call statement names a variable or a constant of a module, not a procedure.
A call statement invokes a procedure, with Call or without: what it names is a Sub, a Function or a Property - not a variable, whatever it holds.
A variable or a constant of the procedure the statement is in is VBC09364 Expected Sub, Function, or Property instead. A variable that
holds an object is not this error: the statement calls the object's default member.
MS-VBA reports the same error, with the same message (recorded in Excel).
This code is raised where the statements of a procedure are checked, at the name the call statement is written with.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
| A variable of a module called. | Public Count As Long … Count (1) |
Call the procedure meant, or assign the variable: Count = 1. |
| The same, named through its module. | Globals.Count (1) |
The same. |
| A constant or an array of a module called. | Public Const K As Long = 1 … K (1) |
Use the value in an expression, as in Debug.Print K. |
A variable of a module called with Call. |
Call Count |
Call the procedure meant. |
See also
⏮️ VBC09369 Can't change data types of array elements | ⏭️ VBC09371 Array argument must be ByRef
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca