Labels are not valid outside methods

You can add a label to a statement only within a Sub, Function, property Get, or property Set procedure. Only an executable statement can have a label, and all executable statements must be inside procedures.

Error ID: BC30016

To correct this error

  • Remove the label from the statement, or move the statement inside a procedure.

See Also

Tasks

How to: Label Statements

Reference

Sub Statement (Visual Basic)

Function Statement (Visual Basic)

Get Statement

Set Statement (Visual Basic)