Article ID: 176164
Article Last Modified on 11/18/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q176164
SYMPTOMS
Setting the default value of an Optional String argument to vbNullString
causes the following error when the project is compiled with Binary
Compatibility:
"<procedure> in the <class> class module has arguments and/or a return
type that is incompatible with a similar declaration in the
version-compatible component"
RESOLUTION
Use quotation marks instead of vbNullString. For example:
Optional myString as String = ""
You may also see the error:
"Variable uses an automation type not supported in Visual Basic (Error 458)."
This occurs when you attempt to set the default value of a Variant optional
argument to Null. Avoid using any of the null-related constants (vbNull,
vbNullString, etc.) when providing a default value for an optional
argument.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
Additional query words: kbVBp500BUG kbVBp600fix kbAutomation kbVBp kbdsd KBCOMPILER kbDSupport
Keywords: kbbug kbfix KB176164