While using type-declaration characters is valid in Visual Basic, some data types (including Byte, Boolean, Date, Object, and Variant) have no associated type-declaration characters. This error has the following causes and solutions:
Either remove the type-declaration character or remove the As clause.
MyVar = 20 ' Implicit declaration.
MyVar% = 25 ' Generates an error.
Either remove the type-declaration character or redeclare the original variable.
Note If an explicit variable declaration contains a type-declaration character, inclusion of the character is optional in later references. For example:
Dim MyStr$
MyStr = "Because it was explicitly declared, the $ is optional."
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).