Skip to content

Latest commit

 

History

History
107 lines (81 loc) · 3.21 KB

Excel.OLEObject.md

File metadata and controls

107 lines (81 loc) · 3.21 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
OLEObject object (Excel)
vbaxl10.chm414072
vbaxl10.chm414072
Excel.OLEObject
bc3ef12d-1531-6c21-71ab-3df6bb851f3b
03/30/2019
medium

OLEObject object (Excel)

Represents an ActiveX control or a linked or embedded OLE object on a worksheet.

Remarks

The OLEObject object is a member of the OLEObjects collection. The OLEObjects collection contains all the OLE objects on a single worksheet.

Example

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.

Worksheets("sheet1").OLEObjects(1).Delete

The following example deletes the OLE object named ListBox1.

Worksheets("sheet1").OLEObjects("ListBox1").Delete

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 
 .Activate 
End With

Events

Methods

Properties

See also

[!includeSupport and feedback]