Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Unable to set XValues Property of Series Class

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Unable to set XValues Property of Series Class

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Unable to set XValues Property of Series Class

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to set the XValues property of the Series class Ben Charts and Charting in Excel 7 December 7th 06 10:01 PM
Unable to set the XValues property of the Series class ramkumar_cpt Charts and Charting in Excel 5 November 29th 05 02:13 PM
Unable to Set XValues property of the Series class PGalla06[_18_] Excel Programming 0 September 30th 05 04:16 PM
Unable to set the xvalues (or values) property of the series class Kate Excel Programming 1 May 5th 05 02:13 PM
Unable to set the XValues property of the Series class David Mullins via OfficeKB.com Excel Programming 0 January 26th 05 02:54 PM


All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"