OLEObject Object [Excel 2003 VBA Language Reference]

Multiple objects

Represents an ActiveX control or a linked or embedded OLE object on a worksheet. The OLEObject object is a member of the OLEObjects collection. The OLEObjects collection contains all the OLE objects on a single worksheet.

Using the OLEObject Object

Use OLEObjects(index), where index is the name or number of the object, to return an OLEObject object. The following example deletes OLE object one on Sheet1.


The following example deletes the OLE object named "ListBox1."



The properties and methods of the OLEObject object are duplicated on each ActiveX control on a worksheet. This enables Visual Basic code to gain access to these properties by using the control's name. The following example selects the check box control named "MyCheckBox," aligns it with the active cell, and then activates the control.

With MyCheckBox
    .Value = True
    .Top = ActiveCell.Top
End With

For more information, see Using ActiveX controls on sheets .

Properties | Application Property | AutoLoad Property | AutoUpdate Property | Border Property | BottomRightCell Property | Creator Property | Enabled Property | Height Property | Index Property | Interior Property | Left Property | LinkedCell Property | ListFillRange Property | Locked Property | Name Property | Object Property | OLEType Property | Parent Property | Placement Property | PrintObject Property | ProgId Property | Shadow Property | ShapeRange Property | SourceName Property | Top Property | TopLeftCell Property | Visible Property | Width Property | ZOrder Property

Methods | Activate Method | BringToFront Method | Copy Method | CopyPicture Method | Cut Method | Delete Method | Duplicate Method | Select Method | SendToBack Method | Update Method | Verb Method

Events | GotFocus Event | LostFocus Event

Parent Objects

Child Objects | Border Object | Interior Object | Range Object | ShapeRange Object