ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unable to Set XValues property of the Series class (https://www.excelbanter.com/excel-programming/341575-unable-set-xvalues-property-series-class.html)

PGalla06[_18_]

Unable to Set XValues property of the Series class
 

I'm trying to input the text stored in an array into the XValues fiel
in a chart, and I keep encountering the above message. I have no ide
what it means and how to fix the error. Any help someone could provid
is greatly appreciated. Below is the code that I'm using:


ReDim LagArray(NmRows)

Range("A3").Select

For i = 0 To (NmRows - 3)

Set MyRange = Worksheets("LagWorksheet").Range("A" & (3 + i))

LagArray(i) = LTrim(Mid(MyRange, 4, 7))

Next i
'---------------------------------------
Sheets.Add
ActiveSheet.Name = "LagGraph"
Range("A1").Select

Charts.Add
ActiveChart.ChartType = xl3DArea
ActiveChart.SetSourceDat
Source:=Sheets("LagWorksheet").Range("C22"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = LagArray <- Here's wher
I encounter the problem
ActiveChart.SeriesCollection(1).Values = "=LagWorksheet!R3C5:R"
NmRows & "C5"
ActiveChart.SeriesCollection(1).Name = GroupArray(2)
ActiveChart.SeriesCollection(2).XValues = LagArray
ActiveChart.SeriesCollection(2).Values = "=LagWorksheet!R3C6:R"
NmRows & "C6"
ActiveChart.SeriesCollection(2).Name = GroupArray(1)
ActiveChart.SeriesCollection(3).XValues = LagArray
ActiveChart.SeriesCollection(3).Values = "=LagWorksheet!R3C7:R"
NmRows & "C7"
ActiveChart.SeriesCollection(3).Name = GroupArray(0)
ActiveChart.Location Whe=xlLocationAsObject, Name:="LagGraph

--
PGalla0
-----------------------------------------------------------------------
PGalla06's Profile: http://www.excelforum.com/member.php...fo&userid=2426
View this thread: http://www.excelforum.com/showthread.php?threadid=47213



All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com