Table of contents
TOC
Collapse the table of content
Expand the table of content

Must be first statement on the line

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Not all keywords can appear at the beginning of a line of code. This error has the following causes and solutions:

  • You preceded a Sub, Function, or Property statement with another statement on the same line. A Sub, Function, or Property statement must always be the first statement on any line in which it appears (unless preceded by the keyword Public, Private, or Static ).

  • You preceded an End If, Else, or ElseIf statement with another statement on the same line. An End If, Else, or ElseIf (only when used in a block If structure) statement must always be the first statement on any line in which it appears.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

© 2018 Microsoft