Leer en inglés

Compartir a través de


WorksheetBase.OLEObjects(Object) Method

Definition

Gets an object that represents either a single OLE object (an OLEObject) or a collection of all OLE objects (an OLEObjects collection) on the worksheet.

C#
public object OLEObjects(object index);

Parameters

index
Object

The name or number of the OLE object.

Returns

An object that represents either a single OLE object (an OLEObject) or a collection of all OLE objects (an OLEObjects collection) on the worksheet.

Examples

The following code example uses the OLEObjects method to display the number of OLE objects in the current worksheet.

This example is for a document-level customization.

C#
private void DisplayOLEObjectsCount()
{
    Excel.OLEObjects oleObjects1 = (Excel.OLEObjects)this.OLEObjects();
    MessageBox.Show("There are " + oleObjects1.Count + " OLE objects in " +
        "this worksheet.");
}

Remarks

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Applies to

Producto Versiones
Visual Studio Tools for Office 2017, 2019, 2022