Table of Contents

VBC00055 — Only comments may appear after End Sub, End Function, or End Property

Severity: Error  ·  Family: VBC (parser / concrete syntax tree)  ·  Source metadata: VBSyntaxErrorInfo

A declaration or a statement is written after the first procedure of a module.

Once a module's first procedure is declared, only procedures and comments may follow: its declarations section is above it.

MS-VBA reports the same error, with the same message (recorded in Excel).

This code is raised by the parser, at the first statement of each stretch that does not belong there, when the grammar refuses the module.

How it is raised

Situation Example Resolution
A variable declared after a procedure. End Sub … Dim z As Long Move the declaration above the first procedure.
An Option statement after a procedure. End Sub … Option Explicit Move it to the top of the module.

See also


⏮️ VBC00054 Invalid outside procedure | ⏭️ VBC09301 Ambiguous name detected


ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca