设置图表源数据失败

Set Chart Source Data fails

以下语句失败:

wksGraphTotal.ChartObjects("TotQuestion").SetSourceData Source:=wksGraphTotal.Range("$A:$C")

Object doesn't support this property or method

但是如果我单击图表并在 Excel 功能区中选择 "Select Data",我可以毫无问题地将图表数据范围设置为 ='Graph Total'!$A:$C

我做错了什么?

这会起作用。

wksGraphTotal.ChartObjects("TotQuestion").Chart.SetSourceData Source:=wksGraphTotal.Range("$A:$C")