Microsoft KB Archive/157158

= XL97: Macro Doesn't Recognize OLEObject Name Property =

Article ID: 157158

Article Last Modified on 10/21/2000

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition

-



This article was previously published under Q157158



SYMPTOMS
When you run a macro that refers to an ActiveX OLEObject drawn on the worksheet, you may receive the following error:

Run-time error: '1004'

Unable to get the OLEObjects property of the worksheet class



WORKAROUND
When you refer to the object by its name, use the name defined on the worksheet and not the object's name property. To view and edit the name defined on the worksheet, click in the Name box next to the Formula Bar.

If you need to reference an OLEObject in a macro, change the object's name in the following manner:
 * 1) Click once on the object to select it.
 * 2) Click in the Name box (next to the Formula Bar) and type the new name.
 * 3) Press ENTER.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem no longer occurs in Microsoft Excel 2000.

Additional query words: XL97 8.00 OLE

Keywords: kbmacro kbprogramming kbprb KB157158

-

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

© Microsoft Corporation. All rights reserved.