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

Type-declaration character required

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

The necessity of using type-declaration characters depends on the form of theidentifier's declaration. This error has the following cause and solution:

  • A variable that was originally implicitly declared with a type-declaration characters was referenced without a type-declaration character. For example:

    MyStr$ = "Implicit declaration" 
    MyStr = "Trying to refer to MyStr$, but error results" _ 
    &; "from calling it MyStr." 
    
Dim MyStr$  
MyStr = "Because it was explicitly declared, the $ is optional." 
Either make the declaration explicit, or add the type-declaration character to later references.

 **Note**  If an explicit variable declaration contains a type-declaration character, inclusion of the character is optional in later references. For example:

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

© 2018 Microsoft