VBC09366 — A module is not a valid type
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
A declaration is typed with the name of a standard module.
A standard module is not a type: no variable, parameter or function result can be one. Only a class module, a user-defined type or an enumeration declares a type.
MS-VBA reports the same error, with the same message (recorded in Excel). A module of a library, such as Strings, is VBC09373 instead.
This code is raised where the types declarations are written with are resolved, where a ReDim states a type, and where a TypeOf ... Is names one.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
| A variable typed as a module. | Dim x As Globals |
Declare it with a type, or with the class module meant. |
A ReDim that states a module. |
ReDim a(1) As Globals |
State the type of the elements. |
A TypeOf ... Is that names a module. |
If TypeOf o Is Globals Then |
Name the class tested for. |
See also
⏮️ VBC09365 Range has no values | ⏭️ VBC09367 Invalid use of AddressOf operator
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca