Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using a variable to dictate which chart series I am working with however
I am recieving the following error: Run-time error '1004' Unable to set XValues property of Series Class My code looks like: Dim StrtRng, i As Long 'Redirect Chart Elements TierVar = Range(Comp3Tier.Address).Value 'ActiveCell.Offset(0, (Comp3Tier.Column - CostRng.Column)).Value With Charts(activesheet.Name & "_Chart") 'RngStrg ..SeriesCollection(TierVar).XValues = "=DataSheet!R" & StrtRng & "C5:R" & i & "C5" ..SeriesCollection(TierVar).Values = "=DataSheet!R" & StrtRng & "C6:R" & i & "C6" ..SeriesCollection(5).XValues = "=DataSheet!R" & i & "C7:R" & (i + 1) & "C7" ..SeriesCollection(5).Values = "=DataSheet!R" & i & "C8:R" & (i + 1) & "C8" ..SeriesCollection(4).XValues = "=DataSheet!R" & i & "C9:R" & (i + 1) & "C9" ..SeriesCollection(4).Values = "=DataSheet!R" & i & "C10:R" & (i + 1) & "C10" ..SeriesCollection(6).XValues = "=DataSheet!R" & i & "C11:R" & (i + 1) & "C11" ..SeriesCollection(6).Values = "=DataSheet!R" & i & "C12:R" & (i + 1) & "C12" ..SeriesCollection(7).XValues = "=DataSheet!R" & i & "C13:R" & (i + 1) & "C13" ..SeriesCollection(7).Values = "=DataSheet!R" & i & "C14:R" & (i + 1) & "C14" End With StrtRng = i + 1 End If ActiveCell.Offset(1, 0).Activate i = i + 1 Loop |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Make sure the range contains valid data. Also, I doubt that it matters, but
I invariably define the Y values first. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "DynamiteSkippy" wrote in message ... I am using a variable to dictate which chart series I am working with however I am recieving the following error: Run-time error '1004' Unable to set XValues property of Series Class My code looks like: Dim StrtRng, i As Long 'Redirect Chart Elements TierVar = Range(Comp3Tier.Address).Value 'ActiveCell.Offset(0, (Comp3Tier.Column - CostRng.Column)).Value With Charts(activesheet.Name & "_Chart") 'RngStrg .SeriesCollection(TierVar).XValues = "=DataSheet!R" & StrtRng & "C5:R" & i & "C5" .SeriesCollection(TierVar).Values = "=DataSheet!R" & StrtRng & "C6:R" & i & "C6" .SeriesCollection(5).XValues = "=DataSheet!R" & i & "C7:R" & (i + 1) & "C7" .SeriesCollection(5).Values = "=DataSheet!R" & i & "C8:R" & (i + 1) & "C8" .SeriesCollection(4).XValues = "=DataSheet!R" & i & "C9:R" & (i + 1) & "C9" .SeriesCollection(4).Values = "=DataSheet!R" & i & "C10:R" & (i + 1) & "C10" .SeriesCollection(6).XValues = "=DataSheet!R" & i & "C11:R" & (i + 1) & "C11" .SeriesCollection(6).Values = "=DataSheet!R" & i & "C12:R" & (i + 1) & "C12" .SeriesCollection(7).XValues = "=DataSheet!R" & i & "C13:R" & (i + 1) & "C13" .SeriesCollection(7).Values = "=DataSheet!R" & i & "C14:R" & (i + 1) & "C14" End With StrtRng = i + 1 End If ActiveCell.Offset(1, 0).Activate i = i + 1 Loop |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I should mention that I initially had no problems with this code and this
issue only arises occasionally and I haven't figured out the rhyme or reason why it occasionally works. I have played around with it several different ways and each time the data is valid [numerical] and I tried changing order of .xvalues and .values statements, but still this occurs no matter which statement is first. Does anyone know if I should be using the .formula method rather than .value ? Any ideas?? -D |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unable to set the XValues property of the Series class | Charts and Charting in Excel | |||
Unable to set the XValues property of the Series class | Charts and Charting in Excel | |||
Unable to Set XValues property of the Series class | Excel Programming | |||
Unable to set the xvalues (or values) property of the series class | Excel Programming | |||
Unable to set the XValues property of the Series class | Excel Programming |