View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sisilla[_2_] Sisilla[_2_] is offline
external usenet poster
 
Posts: 34
Default Unable to set the xvalues property of the series class for a single row of source data

Hello All,

The following code works if there is more than one row of source
data.

ActiveChart.SeriesCollection(1).XValues = "='" & ws.Name & "'!
R2C3:R" & LastRow + 1 & "C3"
ActiveChart.SeriesCollection(1).Values = "='" & ws.Name & "'!
R2C4:R" & LastRow + 1 & "C4"
ActiveChart.SeriesCollection(1).Name = "='" & ws.Name & "'!
R1C4"
ActiveChart.SeriesCollection(2).XValues = "='" & ws.Name & "'!
R2C3:R" & LastRow + 1 & "C3"
ActiveChart.SeriesCollection(2).Values = "='" & ws.Name & "'!
R2C5:R" & LastRow + 1 & "C5"
ActiveChart.SeriesCollection(2).Name = "='" & ws.Name & "'!
R1C5"
ActiveChart.SeriesCollection(3).XValues = "='" & ws.Name & "'!
R2C3:R" & LastRow + 1 & "C3"
ActiveChart.SeriesCollection(3).Values = "='" & ws.Name & "'!
R2C6:R" & LastRow + 1 & "C6"
ActiveChart.SeriesCollection(3).Name = "='" & ws.Name & "'!
R1C6"

Otherwise (if LastRow = 1), the following line

ActiveChart.SeriesCollection(3).XValues = "='" & ws.Name & "'!R2C3:R"
& LastRow + 1 & "C3"

gives the following error

Unable to set the xvalues property of the series class

I am able to set the xvalues property for both SeriesCollection(1) and
SeriesCollection(2) to the same range that I am attempting to set
SeriesCollection(3)'s to. The range is non-empty and contains less
than 253 cells.

Any ideas as to what may be causing this? I appreciate any effort to
help me. Thank you for your time and consideration.

Sincerely,
Sisilla