VBC09374 — Expected user-defined type, not project
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
A type is written with the name of a project or a library, such as VBA.
A project holds modules and types, and is not a type itself. A type of a library is written after the library's name and a dot: VBA.Collection.
MS-VBA reports the same error, with the same message (recorded in Excel).
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, a parameter or a result typed as a project. | Dim p As VBA |
Name the type of the project meant: Dim c As VBA.Collection. |
A TypeOf ... Is that names a project. |
If TypeOf o Is VBA Then |
Name the class tested for: If TypeOf o Is VBA.Collection Then. |
See also
⏮️ VBC09373 Automation type not supported in Visual Basic | ⏭️ VBC09375 Invalid length for fixed-length string
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca