PSS ID Number: 114696
Article Last Modified on 1/17/2001
The information in this article applies to:
- Microsoft Visual Basic for Applications 1.0
This article was previously published under Q114696
SYMPTOMS
In a Microsoft Visual Basic Programming System, Applications Edition,
procedure, if you enter the Call statement followed by a Function procedure
and the function name contains a type-declaration character, you receive
the following error message:
Expected: Identifier without type suffix or bracketed expression or .
If you clear the Display Syntax Errors check box on the Module General tab
of the Options dialog box, or you ignore the above error message, you
receive a syntax error when you run the procedure that contains this Call
statement.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. We are researching this problem
and will post new information here in the Microsoft Knowledge Base as it
becomes available.
CAUSE
This problem occurs because when you use the Call statement to call a
Function procedure, the return value is discarded. If you call a Function
procedure as you would call a Sub procedure, using the Call statement, the
Function procedure name must follow the Sub procedure naming rules, and a
Sub procedure name cannot contain a type-declaration character.
WORKAROUND
To avoid receiving this error message, or a syntax error when you run a Function procedure, do either of the following:
- Do not use a type-declaration character in your function name. Instead,
use the As keyword with the Function statement to declare the function
return value type. The following example defines the value returned by
the Test function as string type:
Function Test(x) as String
-or-
- Do not use the Call statement to run the function when the function name
contains a type-declaration character.
REFERENCES
For a definition of the Type-Declaration Character, choose the Search
button in the Visual Basic Reference and type:
type-declaration character
For more information about the Call statement, choose the Search button in
the Visual Basic Reference and type:
Additional query words: errmsg err msg
Keywords: KB114696
Technology: kbVBA100 kbVBASearch kbZNotKeyword3 kbZNotKeyword6