Skip to content

Files

Latest commit

 

History

History
60 lines (40 loc) · 1.37 KB

Excel.Chart.OLEObjects.md

File metadata and controls

60 lines (40 loc) · 1.37 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Chart.OLEObjects method (Excel)
vbaxl10.chm149126
vbaxl10.chm149126
Excel.Chart.OLEObjects
e42150c1-8661-75b4-f1e8-fec8cc82f59b
04/16/2019
medium

Chart.OLEObjects method (Excel)

Returns an object that represents either a single OLE object (an OLEObject) or a collection of all OLE objects (an OLEObjects collection) on the chart or sheet. Read-only.

Syntax

expression.OLEObjects (Index)

expression A variable that represents a Chart object.

Parameters

Name Required/Optional Data type Description
Index Optional Variant The name or number of the OLE object.

Return value

Object

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

[!includeSupport and feedback]