VBC09351 — Invalid data type for constant
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
The value of a constant is an object.
A constant holds a value - a number, a String, a date, a Boolean - and never an object: Nothing is no value a constant can have.
MS-VBA reports the same error, with the same message (recorded in Excel).
This code is raised by ConstantExpressionStaticSemantics.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
Nothing. |
Const k = Nothing |
Use an object variable instead. |
See also
⏮️ VBC09350 Constant expression required | ⏭️ VBC09352 Overflow
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca