ChartObjects Method [Excel 2003 VBA Language Reference]

Returns an object that represents either a single embedded chart (a ChartObject object) or a collection of all the embedded charts (a ChartObjects object) on the sheet.


expression Required. An expression that returns an object in the Applies To list. If you specify a Chart object, it must be a chart sheet (it cannot be an embedded chart).

Index   Optional Variant. The name or number of the chart. This argument can be an array, to specify more than one chart.


This method isn't equivalent to the Charts property. This method returns embedded charts; the Charts property returns chart sheets. Use the Chart property to return the Chart object for an embedded chart.


This example adds a title to embedded chart one on Sheet1.

With Worksheets("Sheet1").ChartObjects(1).Chart
    .HasTitle = True
    .ChartTitle.Text = "1995 Rainfall Totals by Month"
End With

This example creates a new series in embedded chart one on Sheet1. The data source for the new series is the range B1:B10 on Sheet1.

ActiveChart.SeriesCollection.Add _

This example clears the formatting of embedded chart one on Sheet1.


Applies to | Chart Object | Worksheet Object

See Also | Charts Property