OLEObject Object

Excel Developer Reference

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.


Use OLEObjects(


), where


is the name or number of the object, to return an OLEObject object. The following example deletes OLE object one on Sheet1.

Visual Basic for Applications

The following example deletes the OLE object named “ListBox1.”

Visual Basic for Applications

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.

Visual Basic for Applications
  With MyCheckBox
    .Value = True
    .Top = ActiveCell.Top
End With

See Also