0

The following statement fails:

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

Object doesn't support this property or method

But if I click on the chart and choose "Select Data" in the Excel ribbon, I can set the Chart data range to ='Graph Total'!$A$2:$C$62 without a problem.

What am I doing wrong?

ZygD
  • 22,092
  • 39
  • 79
  • 102
user1283776
  • 19,640
  • 49
  • 136
  • 276

1 Answers1

2

This will work.

wksGraphTotal.ChartObjects("TotQuestion").Chart.SetSourceData Source:=wksGraphTotal.Range("$A$2:$C$62")
ZygD
  • 22,092
  • 39
  • 79
  • 102