Class ChartObject (Excel VBA)
The class ChartObject represents an embedded chart on a worksheet.
Dim chro as ChartObject
Set chro = ActiveSheet.ChartObjects(Index:=1)
For Each
Here is an example of processing the ChartObject items in a collection.
Dim chro As ChartObject
For Each chro In ActiveSheet.ChartObjects()
Next chro
Methods
Activate - Makes the current chart the active chart.
BringToFront - Brings the object to the front of the z-order.
Copy - Copies the object to the Clipboard.
CopyPicture - Copies the selected object to the Clipboard as a picture.
Cut - Cuts the object to the Clipboard.
Delete - Deletes the object.
Duplicate - Duplicates the object and returns a reference to the new copy.
Select - Selects the object.
SendToBack - Sends the object to the back of the z-order.
Properties
BottomRightCell returns a Range object that represents the cell that lies under the lower-right corner of the object.
Chart returns a Chart object that represents the chart contained in the object.
Height returns or sets a Double value that represents the height, in points, of the object.
Index returns a Long value that represents the index number of the object within the collection of similar objects.
Left returns or sets a Double value that represents 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 returns or sets a Boolean value that indicates if the object is locked.
Name returns a String value representing the name of the object.
Placement returns or sets a Variant value, containing an XlPlacement constant, that represents the way the xlplacement is attached to the cells below it.
PrintObject true if the object will be printed when the document is printed.
ProtectChartObject true if the embedded chart frame cannot be moved, resized, or deleted through the user interface.
RoundedCorners true if the embedded chart has rounded corners.
Shadow returns or sets a Boolean value that determines 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.
Top returns or sets a Double value that represents 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).
TopLeftCell returns a Range object that represents the cell that lies under the upper-left corner of the specified object.
Visible returns or sets a Boolean value that determines whether the object is visible.
Width returns or sets a Double value that represents the width, in points, of the object.
ZOrder returns the z-order position of the object.
Related Classes
Chart - Represents a chart in a workbook.
Range - Represents a cell, a row, a column, a selection of cells containing one or more contiguous blocks of cells, or a 3D range.
ShapeRange - Represents a shape range, which is a set of shapes on a document.