VBC09373 — Automation type not supported in Visual Basic
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
A type is written with the name of a module of a library, such as Strings or VBA.Strings.
A module of a library holds functions, like Len and Left, and no variable can be of its type: it is not a type. Only a class, a user-defined type or
an enumeration is.
MS-VBA reports the same error, with the same message (recorded in Excel). A module of your own project is VBC09366 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, a parameter or a result typed as a library's module. | Dim s As Strings, Function Words() As VBA.Strings |
Declare it with the type meant: Dim s As String. |
A ReDim that states a library's module. |
ReDim a(1) As Strings |
State the type of the elements: ReDim a(1) As String. |
A TypeOf ... Is that names a library's module. |
If TypeOf o Is Strings Then |
Name the class tested for: If TypeOf o Is Collection Then. |
See also
⏮️ VBC09372 Member already exists in an object module from which this object module derives | ⏭️ VBC09374 Expected user-defined type, not project
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca