Microsoft KB Archive/276560

= BUG: Compiler Error with Left Function When Devshll.dll Is Referenced =

Article ID: 276560

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition

-



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 = &quot;skdfhshfsdlkf&quot; s = VBA.Left(s, 3) 'Fully qualified End Sub



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Problem
 In Visual Basic version 6.0, create a new Standard EXE project. Form1 is created by default. Add a class module to the project.  Add the following code to the class module: Sub foot Dim s As String s = &quot;skdfhshfsdlkf&quot; s = Left(s, 3) End Sub  Set a reference to Visual C++ Shared Objects (Devshl.dll). Press CTRL+F5 to start the application with full compile. You receive the error message listed in the &quot;Symptoms&quot; section.</li></ol>

Additional query words: Automate IDE Name

Keywords: kbbug kbpending kbcompiler KB276560

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.