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. |
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"
.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.