Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Unable to Get OLE Object's Property Referencing Collection


View products that this article applies to.

This article was previously published under Q213788

↑ Back to the top


Symptoms

When you attempt to get a property of an ActiveX control using the OLEObjects method, the following error message may appear:
Run-time error '1004':

Unable to get the property name property of the class name class.
For example, running a macro containing this statement
x = Sheet1.OLEObjects.Border.ColorIndex
				
should return the ColorIndex property of the Border class, but the following error message appears:
Run-time error '1004':

Unable to get the ColorIndex property of the Border class.

↑ Back to the top


Workaround

To work around this problem, refer to the index number of the ActiveX control. Instead of referring to the OLEObjects collection, refer to a single OLE object. For the example above, use the following statement to return the ColorIndex property of the Border class:
x = Sheet1.OLEObjects(1).Border.ColorIndex
				

↑ Back to the top


Status

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

↑ Back to the top


Keywords: KB213788, kbprogramming, kbpending, kberrmsg, kbdtacode, kbbug

↑ Back to the top

Article Info
Article ID : 213788
Revision : 6
Created on : 10/11/2006
Published on : 10/11/2006
Exists online : False
Views : 240