OLEObject Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents an ActiveX control or a linked or embedded OLE object on a worksheet. The OLEObject object is a member of the OLEObjects collection. The OLEObjects collection contains all the OLE objects on a single worksheet.
public interface class OLEObject : Microsoft::Office::Interop::Excel::_OLEObject, Microsoft::Office::Interop::Excel::OLEObjectEvents_Event
[System.Runtime.InteropServices.Guid("000208A2-0000-0000-C000-000000000046")]
public interface OLEObject : Microsoft.Office.Interop.Excel._OLEObject, Microsoft.Office.Interop.Excel.OLEObjectEvents_Event
Public Interface OLEObject
Implements _OLEObject, OLEObjectEvents_Event
- Derived
- Attributes
- Implements
Remarks
This is a .NET interface derived from a COM coclass that is required by managed code for interoperability with the corresponding COM object. Use this derived interface to access all method, property, and event members of the COM object. However, if a method or event you want to use shares the same name under the same COM object, cast to the corresponding primary interface to call the method, and cast to the latest events interface to connect to the event. Refer to this topic for information about the COM object. For information about the method and property members of the COM object, see _OLEObject.
Use OLEObjects(index
), where index
is the name or number of the object, to return an OLEObject object.
The properties and methods of the OLEObject object are duplicated on each ActiveX control on a worksheet. This enables access to these properties by using the control’s name.
Properties
AltHTML |
Reserved for internal use. (Inherited from _OLEObject) |
Application |
This property returns an Application object that represents the creator of the specified object (you can use this property with an OLE Automation object to return the application of that object). Read-only. (Inherited from _OLEObject) |
AutoLoad |
True if the OLE object is automatically loaded when the workbook that contains it is opened. Read/write Boolean. (Inherited from _OLEObject) |
AutoUpdate |
True if the OLE object is updated automatically when the source changes. Valid only if the object is linked (its OLEType property must be xlOLELink). Read-only Boolean. (Inherited from _OLEObject) |
Border |
Returns a Border object that represents the border of the object. (Inherited from _OLEObject) |
BottomRightCell |
Returns a Range object that represents the cell that lies under the lower-right corner of the object. Read-only. (Inherited from _OLEObject) |
Creator |
Returns a 32-bit integer that indicates the application in which this object was created. If the object was created in Microsoft Excel, this property returns the string XCEL, which is equivalent to the hexadecimal number 5843454C. Read-only xlCreatorCode. (Inherited from _OLEObject) |
Enabled |
True if the object is enabled. Read/write Boolean. (Inherited from _OLEObject) |
Height |
The height, in points, of the object. Read/write Double. (Inherited from _OLEObject) |
Index |
Returns the index number of the object within the collection of similar objects. Read-only Integer. (Inherited from _OLEObject) |
Interior |
Returns an Interior object that represents the interior of the specified object. (Inherited from _OLEObject) |
Left |
The distance, in points, from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart). Read/write Double. (Inherited from _OLEObject) |
LinkedCell |
Returns or sets the worksheet range linked to the control's value. If you place a value in the cell, the control takes this value. Likewise, if you change the value of the control, that value is also placed in the cell. Read/write String. (Inherited from _OLEObject) |
ListFillRange |
Returns or sets the worksheet range used to fill the specified list box. Setting this property destroys any existing list in the list box. Read/write String. (Inherited from _OLEObject) |
Locked |
True if the object is locked, False if the object can be modified when the sheet is protected. Read/write Boolean. (Inherited from _OLEObject) |
Name |
Returns or sets the name of the object. Read/write String. (Inherited from _OLEObject) |
Object |
Returns the OLE Automation object associated with this OLE object. Read-only Object. (Inherited from _OLEObject) |
OLEType |
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 Object. (Inherited from _OLEObject) |
OnAction |
Returns or sets the name of a macro that’s run when the specified object is clicked. Read/write String. (Inherited from _OLEObject) |
Parent |
Returns the parent object for the specified object. Read-only. (Inherited from _OLEObject) |
Placement |
Returns or sets the way the object is attached to the cells below it. Read/write Object. (Inherited from _OLEObject) |
PrintObject |
True if the object will be printed when the document is printed. Read/write Boolean. (Inherited from _OLEObject) |
progID |
Returns the programmatic identifiers for the object. Read-only String. (Inherited from _OLEObject) |
Shadow |
True if the font is a shadow font or if the object has a shadow. Read/write Boolean. (Inherited from _OLEObject) |
ShapeRange |
Returns a ShapeRange object that represents the specified object or objects. Read-only. (Inherited from _OLEObject) |
SourceName |
Returns or sets the specified object's link source name. Read/write String. (Inherited from _OLEObject) |
Top |
The distance, in points, from the top edge of the object to the top of row 1 (on a worksheet) or the top of the chart area (on a chart). Read/write Double. (Inherited from _OLEObject) |
TopLeftCell |
Returns a Range object that represents the cell that lies under the upper-left corner of the specified object. Read-only. (Inherited from _OLEObject) |
Visible |
Determines whether the object is visible. Read/write Boolean. (Inherited from _OLEObject) |
Width |
The width, in points, of the object. Read/write Double. (Inherited from _OLEObject) |
ZOrder |
Returns the z-order position of the object. Read-only Integer. (Inherited from _OLEObject) |
Methods
Activate() |
Activates the object. (Inherited from _OLEObject) |
BringToFront() |
Brings the object to the front of the z-order. (Inherited from _OLEObject) |
Copy() |
Copies the object to the Clipboard. (Inherited from _OLEObject) |
CopyPicture(XlPictureAppearance, XlCopyPictureFormat) |
Copies the selected object to the Clipboard as a picture. Object. (Inherited from _OLEObject) |
Cut() |
Cuts the object to the Clipboard or pastes it into a specified destination. (Inherited from _OLEObject) |
Delete() |
Deletes the object. (Inherited from _OLEObject) |
Duplicate() |
Duplicates the object and returns a reference to the new copy. (Inherited from _OLEObject) |
Select(Object) |
Selects the object. (Inherited from _OLEObject) |
SendToBack() |
Sends the object to the back of the z-order. (Inherited from _OLEObject) |
Update() |
Updates the link. (Inherited from _OLEObject) |
Verb(XlOLEVerb) |
Sends a verb to the server of the specified OLE object. (Inherited from _OLEObject) |
Events
GotFocus | (Inherited from OLEObjectEvents_Event) |
LostFocus | (Inherited from OLEObjectEvents_Event) |