Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Declaration expected
Collapse the table of content
Expand the table of content

Declaration expected

A nondeclarative statement, such as an assignment or loop statement, occurs outside any procedure. Only declarations are allowed outside procedures.

Alternatively, a programming element is declared without a declaration keyword such as Dim or Const.

Error ID: BC30188

To correct this error

  • Move the nondeclarative statement to the body of a procedure.

  • Begin the declaration with an appropriate declaration keyword.

  • Ensure that a declaration keyword is not misspelled.

© 2015 Microsoft