Share via


'<specifier>' is not valid on a member variable declaration

A Dim statement contains an invalid keyword. A Dim statement can include only the Friend, Private, Protected, Public, ReadOnly, Shadows, Shared, or Static keywords.

This message can also appear if you declare a Static variable outside of a procedure. You can use Static only at procedure level.

Note that if you include a valid keyword in a Dim statement, you can optionally omit the Dim keyword.

Error ID: BC30235

To correct this error

  1. Remove the invalid keyword from the Dim statement.

  2. If you have declared a Static variable outside of a procedure, either move the declaration inside a procedure or remove the Static keyword.

See Also

Reference

Dim Statement (Visual Basic)