Statement cannot appear outside of a method body

Executable statements must be used within procedures.

Error ID: BC30689

To correct this error

  • Move the statement into a procedure or subroutine.

See Also

Concepts

Procedures in Visual Basic