Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.28 KB

Excel.OLEObject.OLEType.md

File metadata and controls

49 lines (34 loc) · 1.28 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
OLEObject.OLEType property (Excel)
vbaxl10.chm417077
vbaxl10.chm417077
Excel.OLEObject.OLEType
ec26dc86-5a31-ca8b-97c7-fe513fb283b1
05/02/2019
medium

OLEObject.OLEType property (Excel)

Returns the OLE object type. Can be one of the following XlOLEType constants: xlOLELink or xlOLEEmbed. Returns xlOLELink if the object is linked (it exists outside of the file), or returns xlOLEEmbed if the object is embedded (it's entirely contained within the file). Read-only Long.

Syntax

expression.OLEType

expression A variable that represents an OLEObject 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]