OLEObjects Method

Applies To

Chart Object, DialogSheet Object, Worksheet Object.

Description

Accessor. Returns an object that represents a single OLE Object (an OLEObject, Syntax 1) or a collection of all OLE objects (an OLEObjects collection, Syntax 2) on the chart or sheet. Read-only.

Syntax 1

object.OLEObjects(index)

Syntax 2

object.OLEObjects

object

Required. The Chart, DialogSheet, or Worksheet object.

index

Required for Syntax 1. The name or number of the OLE object.

See Also

Charts Method, OLEType Property.

Example

This example creates a list of link types for OLE objects on Sheet1. The list appears on a new worksheet created by the example.


Set newSheet = Worksheets.Add
i = 2
newSheet.Range("A1").Value = "Name"
newSheet.Range("B1").Value = "Link Type"
For Each obj In Worksheets("Sheet1").OLEObjects
    newSheet.Cells(i, 1).Value = obj.Name
    If obj.OLEType = xlOLELink Then
        newSheet.Cells(i, 2) = "Linked"
    Else
        newSheet.Cells(i, 2) = "Embedded"
    End If
    i = i + 1
Next