VBC09343 — LSet allowed only on strings and user-defined types
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
The target of an LSet statement is neither a String nor a user-defined type.
LSet fits a value into the width the target already has: the characters of a String, or the bytes of a user-defined type. A number, a date or an object has no such width.
MS-VBA reports the same error, with the same message (recorded in Excel).
This code is raised by StatementStaticSemanticsEvaluator.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
An LSet of a Long. |
LSet n = "x" |
Assign it with =, or declare the target as a String. |
Notes
A Variant target compiles: what it holds is only known when the code runs.
See also
⏮️ VBC09342 Wrong number of arguments or invalid property assignment | ⏭️ VBC09344 RSet allowed only on strings
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca