Chart.SetSourceData (Word)

Sets the source data range for the chart.

SetSourceData (Source, PlotBy)


With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.SetSourceData _ 
 Source:="='Sheet1'!$A$1:$D$5", _ 
 PlotBy:=xlColumns 
 End If 
End With

Arguments

The following argument is required

Source (String) - The address of the chart data range that contains the source data.

Optional arguments

The following argument is optional

PlotBy (XlRowCol) - Specifies the way the data will be plotted. Can be either of the following XlRowCol constants: xlColumns or xlRows.

Possible return values are xlColumns - The data series is in a row, xlRows - The data series is in a column.