Article ID: 108661
Article Last Modified on 10/10/2006
APPLIES TO
- Microsoft Excel 95 Standard Edition
- Microsoft Excel 5.0 Standard Edition
- Microsoft Visual Basic 2.0 Standard Edition
- Microsoft Visual Basic 3.0 Professional Edition
- Microsoft Visual Basic 4.0 Standard Edition
This article was previously published under Q108661
SYMPTOMS
When you run code in a Microsoft Visual Basic version 3.0 application and
the code uses a method or property of an object linking and embedding (OLE)
automation object, you may receive the following error message
Method not applicable for this object
CAUSE
Some of the methods and properties of OLE Automation objects are
keywords in Visual Basic version 3.0 and will cause the error
message above when you use them in a Visual Basic application.
WORKAROUND
To use a method or property of a Microsoft Excel object in a Visual
Basic application when the method or property is a Visual Basic
keyword, use square brackets ([]) around the keyword in the Visual
Basic code. For example, to use the Close method of the Microsoft
Excel Workbooks object in a Visual Basic application, use the
following syntax:
REFERENCES
For more information about the GetObject Function, choose the Search
button in Microsoft Visual Basic Help and type:
Additional query words: XL
Keywords: kbprogramming KB108661