I need to change the source data in sheet 2 chart1 to another range in sheet 1 using VB

I am trying the following VB code straight from the Help but doesnt work

Charts(1).SetSourceData Source:=Sheets(1).Range("B1:C10"), PlotBy:=xlColumns

I keep getting a 'subscript out of range' message