Class ChartObject (Excel VBA)

The class ChartObject represents an embedded chart on a worksheet.

Member in collection

Item

To use a ChartObject class variable it first needs to be instantiated, for example

Dim chro as ChartObject
Set chro = ActiveSheet.ChartObjects(Index:=1)

The following procedures can be used to set variables of type ChartObject: Duplicate, ChartObjects.Add and ChartObjects.Item.

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

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.

ChartObjects.Add - Creates a new embedded chart.

ChartObjects.Copy - Copies the object to the Clipboard.

ChartObjects.CopyPicture - Copies the selected object to the Clipboard as a picture.

ChartObjects.Cut - Cuts the object to the Clipboard.

ChartObjects.Delete - Deletes the object.

ChartObjects.Duplicate - Duplicates the chartobject and returns a reference to the new copy.

ChartObjects.Item - Returns a single object from a collection.

ChartObjects.Select - Selects the object.

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.

ChartObjects.Count returns a Long value that represents the number of objects in the collection.

ChartObjects.Height returns or sets a Double value that represents the height, in points, of the object.

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

ChartObjects.Locked returns or sets a Boolean value that indicates if the objects are locked.

ChartObjects.Placement returns or sets a Variant value, containing an XlPlacement constant, that represents the way the xlplacements are attached to the cells below them.

ChartObjects.PrintObject true if the objects will be printed when the document is printed.

ChartObjects.ProtectChartObject true if the embedded chart frame cannot be moved, resized, or deleted through the user interface.

ChartObjects.ShapeRange returns a ShapeRange object that represents the specified object or objects.

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

ChartObjects.Visible returns or sets a Boolean value that determines whether the object is visible.

ChartObjects.Width returns or sets a Double value that represents the width, in points, of the object.

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.