spurs
Active Member
- Joined
- Oct 18, 2006
- Messages
- 479
- Office Version
- 2016
- 2013
- 2010
- 2007
- 2003 or older
- Platform
- Windows
I have VBA code that has worked previously in excel 2007. I am now upgrading to excel 2010 but need compatability with excel 2003 - 2010.
I am getting the error
Method xvalues of object series faild when executing code for charting
the code is as follows:
With Sheets("CD-TR Chart").ChartObjects("Chart 1").Chart
.SetSourceData Source:=Sheets("Data").Range("A1:A" & Nreadings), PlotBy:=xlColumns
With .SeriesCollection(1)
.XValues = Worksheets("Data").Range("A1:A" & Nreadings)
.Values = Worksheets("Data").Range("B1:B" & Nreadings)
.Name = "Center Distance"
.Border.ColorIndex = 11
.Border.Weight = xlThin
.Border.LineStyle = xlContinuous
End With
End With
The error occurs on line
.XValues = Worksheets("Data").Range("A1:A" & Nreadings)
A few lines before the code
Worksheets("Data").Range("A1:J" & Nreadings) = Data
executed fine so I know it is not a declaration issue or something like that
Any suggestions on how to make this more stable across all versions of excel vba?
I am getting the error
Method xvalues of object series faild when executing code for charting
the code is as follows:
With Sheets("CD-TR Chart").ChartObjects("Chart 1").Chart
.SetSourceData Source:=Sheets("Data").Range("A1:A" & Nreadings), PlotBy:=xlColumns
With .SeriesCollection(1)
.XValues = Worksheets("Data").Range("A1:A" & Nreadings)
.Values = Worksheets("Data").Range("B1:B" & Nreadings)
.Name = "Center Distance"
.Border.ColorIndex = 11
.Border.Weight = xlThin
.Border.LineStyle = xlContinuous
End With
End With
The error occurs on line
.XValues = Worksheets("Data").Range("A1:A" & Nreadings)
A few lines before the code
Worksheets("Data").Range("A1:J" & Nreadings) = Data
executed fine so I know it is not a declaration issue or something like that
Any suggestions on how to make this more stable across all versions of excel vba?