VBC09315 — Exit Property not allowed in Sub or Function
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
An Exit Property statement is in a Sub or a Function.
MS-VBAL §5.4.2.19 Exit Property Statement requires it to be inside the body of a property declaration. MS-VBA reports the same error: Exit Property not allowed in Function or Sub.
This code is raised by ExitStatementStaticSemantics, which
StatementStaticSemanticsEvaluator and instruction-list lowering
(InstructionListLowering) both ask, when they are told the kind of
procedure the statement is in.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
It is in a Sub. |
Sub Foo() ... Exit Property |
Use Exit Sub. |
It is in a Function. |
Function Foo() ... Exit Property |
Use Exit Function. |
See also
⏮️ VBC09314 Exit Function not allowed in Sub or Property | ⏭️ VBC09319 Duplicate label definition
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca