OLEFormat.Object property (PowerPoint)

Returns the object that represents the specified OLE object's top-level interface. Read-only.

Syntax

expression.Object

expression A variable that represents an OLEFormat object.

Return value

Object

Remarks

This property allows you to access the properties and methods of the application in which an OLE object was created.

Use the TypeName function to determine the type of object this property returns for a specific OLE object.

Example

This example displays the type of object contained in shape one on slide one in the active presentation. Shape one must contain an OLE object.

MsgBox TypeName(ActivePresentation.Slides(1) _
    .Shapes(1).OLEFormat.Object)

This example displays the name of the application in which each embedded OLE object on slide one in the active presentation was created.

For Each s In ActivePresentation.Slides(1).Shapes

    If s.Type = msoEmbeddedOLEObject Then

        MsgBox s.OLEFormat.Object.Application.Name

    End If

Next


This example adds text to cell A1 on worksheet one in the Microsoft Excel workbook contained in shape three on slide one in the active presentation.

With ActivePresentation.Slides(1).Shapes(3)

    .OLEFormat.Object.Worksheets(1).Range("A1").Value = "New text"

End With

See also

OLEFormat Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.