Chart.SetSourceData Method (Project)

Sets a source data range from Excel for a chart.

Syntax

expression. SetSourceData (Source,? PlotBy)

expression A variable that represents a 'Chart' object.

Parameters

Name Required/Optional Data type Description
Source Required String The source data range.
PlotBy Optional Variant Specifies the way the data is plotted. Can be one of the following Office.XlRowCol constants: xlColumns or xlRows.
Source Required STRING
PlotBy Optional VARIANT

Return value

Nothing

Remarks

A chart in a Project report can use a data range from Excel, if Project programmatically accesses an Excel worksheet. The charting object model in Project accepts range address strings for properties and methods that accept Range objects in Excel. A range address string in Project is expressed differently than a range in Excel. For example, the Source parameter can have a range value such as "='Sheet1'!$A$1:$D$5".

See also

Chart Object