BUG: Compiler Error with Left Function When Devshll.dll Is Referenced (276560)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q276560 SYMPTOMS
When you use the Left string function in Visual Basic and your project contains a reference to Microsoft Visual C++ Shared Objects (Devshl.dll), you may receive the following compiler error message:
Wrong number of arguments or invalid property assignment
This does not occur when you use a form module, but may occur when you use a standard or class module.
CAUSE
The compiler seems to resolve the Left function in Devshl.dll instead of in the VBA library. Because Left is a property of the Application and Window objects in Devshl.dll, you receive an error when you call Left as a function.
RESOLUTION
Fully qualify the call to the Left function, as in the following example:
Sub foot()
Dim s As String
s = "skdfhshfsdlkf"
s = VBA.Left(s, 3) 'Fully qualified
End Sub
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kbBug kbCompiler kbDSupport KB276560 |
---|
|