Edytuj

Udostępnij za pośrednictwem


OLEObjects Interface

Definition

A collection of all the OLEObject objects on the specified worksheet. Each OLEObject object represents an ActiveX control or a linked or embedded OLE object.

public interface class OLEObjects : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("000208A3-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(2)]
public interface OLEObjects : System.Collections.IEnumerable
Public Interface OLEObjects
Implements IEnumerable
Attributes
Implements

Remarks

Use the OLEObjects(Object) method to return the OLEObjects collection.

Use the Add(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) method to create a new OLE object and add it to the OLEObjects collection.

An ActiveX control on a sheet has two names: the name of the shape that contains the control, which you can see in the Name box when you view the sheet, and the code name for the control, which you can see in the cell to the right of (Name) in the Properties window. When you first add a control to a sheet, the shape name and code name match. However, if you change either the shape name or code name, the other is not automatically changed to match.

You use the code name of a control in the names of its event procedures. However, when you return a control from the Shapes or OLEObjects collection for a sheet, you must use the shape name, not the code name, to refer to the control by name. For example, assume that you add a check box to a sheet and that both the default shape name and the default code name are CheckBox1. If you then change the control code name by typing chkFinished next to (Name) in the Properties window, you must use chkFinished in event procedures names, but you still have to use CheckBox1 to return the control from the Shapes or OLEObjects collection.

Properties

Application

Returns an Application object that represents the Microsoft Excel application.

AutoLoad

True if the OLE object is automatically loaded when the workbook that contains it is opened.

Border

Returns a Border object that represents the border of the object.

Count

Returns the number of objects in the collection.

Creator

Returns a 32-bit integer that indicates the application in which this object was created.

Enabled

True if the object is enabled.

Height

The height, in points, of the object.

Interior

Returns an Interior object that represents the interior of the specified object.

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).

Locked

True if the object is locked; False if the object can be modified when the sheet is protected.

OnAction

Reserved for internal use.

Parent

Returns the parent object for the specified object.

Placement

Returns or sets the way the object is attached to the cells below it.

PrintObject

True if the object will be printed when the document is printed.

Shadow

True if the font is a shadow font or if the object has a shadow.

ShapeRange

Returns a ShapeRange object that represents the specified object or objects.

SourceName

Returns or sets the specified object's link source name.

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).

Visible

Determines whether the object is visible.

Width

The width, in points, of the object.

ZOrder

Returns the z-order position of the object.

Methods

_Dummy12()

Reserved for internal use.

_Dummy15()

Reserved for internal use.

_Dummy22()

Reserved for internal use.

_Dummy3()

Reserved for internal use.

_Dummy30()

Reserved for internal use.

_Dummy32()

Reserved for internal use.

_Dummy33()

Reserved for internal use.

_Dummy34()

Reserved for internal use.

_Dummy36()

Reserved for internal use.

_Dummy37()

Reserved for internal use.

_Dummy38()

Reserved for internal use.

_Dummy39()

Reserved for internal use.

_Dummy40()

Reserved for internal use.

_Dummy41()

Reserved for internal use.

Add(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

Adds a new OLE object to a sheet. Returns an OLEObject object.

BringToFront()

Brings the object to the front of the z-order.

Copy()

Copies the object to the Clipboard.

CopyPicture(XlPictureAppearance, XlCopyPictureFormat)

Copies the selected object to the Clipboard as a picture.

Cut()

Cuts the object to the Clipboard or pastes it into a specified destination.

Delete()

Deletes the object.

Duplicate()

Duplicates the object and returns a reference to the new copy.

GetEnumerator()
Group()

Reserved for internal use.

Item(Object)

Returns a single object from a collection.

Select(Object)

Selects the object.

SendToBack()

Sends the object to the back of the z-order.

Applies to