Hi, All:
I am getting crazy about this error. I tried everything but no help at all. Here is the simple task I want to do: adding a chart. The code is as below:
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
Set myrange = Worksheets("Sheet1").Range("B16:B18")
ActiveChart.SetSourceData Source:=myrange, PlotBy:=xlColumns
ActiveChart.Location where:=xlLocationAsObject, Name:="Rates"
It always stops at line 3 and complaining about "Subscript out of range". But B16-B18 in sheet1 have data. Please anybody can help me? Thanks a lot!