VBC09362 — Type mismatch: array or user-defined type expected
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
An array is passed to a parameter declared as an array of another type.
A parameter declared as an array (A() As Long) is another name for the array passed to it: an array of another element type cannot be it.
MS-VBA reports the same error, with the same message (recorded in Excel).
This code is raised by ObjectValueStaticSemantics, where the arguments of a call are matched to its parameters.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
An array of Integer to a parameter of Long(). |
Dim a(2) As Integer … TakesLongArray a |
Declare the array with the parameter's element type. |
See also
- RD-VBAL §5.3.1.11 Procedure Invocation Argument Processing
- RD-VBAL §2.6.2 Semantic Compilation Errors
⏮️ VBC09361 ByRef argument type mismatch | ⏭️ VBC09363 Expected variable or procedure, not module
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca