SetSpreadsheetData Method

Binds the specified chart or chartspace to a range of cells on on a worksheet in the Spreadsheet Component. The chart must already be bound to a range of cells in the Spreadsheet Component before you call this method.

expression.SetSpreadsheetData(DataReference, SeriesByRows)

*expression   * Required. An expression that returns a ChartSpace or ChChart object.

DataReference   Required String. A reference to the range of cells to bind to. This can be in the form of a cell reference (A1:D5), or a defined name.

SeriesByRows   Optional Boolean. Specifies whether or not each row represents a data series. Set this property to False if each column represents a data series.

Example

This example binds ChartSpace1 to cells A1:F25 in the first sheet of Spreadsheet1.

ChartSpace1.SetSpreadsheetData "Sheet1!A1:F25", False

Applies to | ChartSpace Object | ChChart Object

See Also | SetData Method