Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Runtime Error 1004 Unable to set the XValues property of series cl

I would appreciate it very much if someone could please help me with the
following problem.

I have several charts that need the source data changed often. I have
created a macro that allows the user to input lot numbers and view the charts
without having to change each charts source data. Sometimes I get a runtime
error when I use the macro to change the source data of charts with a
secondary axis. The error says "Runtime error 1004: Unable to set the xvalues
of the series class." The program always stops on the line with the
secondary x axis. I don't know any other way to refer to the secondary x
axis. Sometimes it works, other times I get an error. Please see the
following example.

Sheets("Measurements").Select
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Booster!R" & a & "C1:R" & b &
"C1" ActiveChart.SeriesCollection(1).Values = "=Booster!R" & a & "C3:R" & b &
"C3"
ActiveChart.SeriesCollection(2).XValues = "=Booster!R" & a & "C1:R" & b & "C1"
ActiveChart.SeriesCollection(2).Values = "=Booster!R" & a & "C6:R" & b & "C6"
ActiveChart.SeriesCollection(3).XValues = "=Booster!R" & a & "C1:R" & b & "C1"
ActiveChart.SeriesCollection(3).Values = "=Booster!R" & a & "C10:R" & b &
"C10"

Thanks
--
Rachel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Runtime Error 1004 Unable to set the XValues property of series cl

What are a and b when you get the error?

In article ,
Rachel wrote:

I would appreciate it very much if someone could please help me with the
following problem.

I have several charts that need the source data changed often. I have
created a macro that allows the user to input lot numbers and view the charts
without having to change each charts source data. Sometimes I get a runtime
error when I use the macro to change the source data of charts with a
secondary axis. The error says "Runtime error 1004: Unable to set the xvalues
of the series class." The program always stops on the line with the
secondary x axis. I don't know any other way to refer to the secondary x
axis. Sometimes it works, other times I get an error. Please see the
following example.

Sheets("Measurements").Select
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Booster!R" & a & "C1:R" & b &
"C1" ActiveChart.SeriesCollection(1).Values = "=Booster!R" & a & "C3:R" & b &
"C3"
ActiveChart.SeriesCollection(2).XValues = "=Booster!R" & a & "C1:R" & b & "C1"
ActiveChart.SeriesCollection(2).Values = "=Booster!R" & a & "C6:R" & b & "C6"
ActiveChart.SeriesCollection(3).XValues = "=Booster!R" & a & "C1:R" & b & "C1"
ActiveChart.SeriesCollection(3).Values = "=Booster!R" & a & "C10:R" & b &
"C10"

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Runtime Error 1004 Unable to set the XValues property of serie

Thank you for your comment. I believe it has helped me solve my problem. It
so happens that when the macro fails, the range of a and b have no data. I
thought excel would simply not plot cells without value. I filled the cells
with "na" and the program has worked every time so far. Thanks again for
your response.
--
Rachel


"JE McGimpsey" wrote:

What are a and b when you get the error?

In article ,
Rachel wrote:

I would appreciate it very much if someone could please help me with the
following problem.

I have several charts that need the source data changed often. I have
created a macro that allows the user to input lot numbers and view the charts
without having to change each charts source data. Sometimes I get a runtime
error when I use the macro to change the source data of charts with a
secondary axis. The error says "Runtime error 1004: Unable to set the xvalues
of the series class." The program always stops on the line with the
secondary x axis. I don't know any other way to refer to the secondary x
axis. Sometimes it works, other times I get an error. Please see the
following example.

Sheets("Measurements").Select
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Booster!R" & a & "C1:R" & b &
"C1" ActiveChart.SeriesCollection(1).Values = "=Booster!R" & a & "C3:R" & b &
"C3"
ActiveChart.SeriesCollection(2).XValues = "=Booster!R" & a & "C1:R" & b & "C1"
ActiveChart.SeriesCollection(2).Values = "=Booster!R" & a & "C6:R" & b & "C6"
ActiveChart.SeriesCollection(3).XValues = "=Booster!R" & a & "C1:R" & b & "C1"
ActiveChart.SeriesCollection(3).Values = "=Booster!R" & a & "C10:R" & b &
"C10"

Thanks


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
Runtime Error 1004 Unable to set the top property of the picture c JB Bates[_2_] Excel Discussion (Misc queries) 1 March 3rd 10 08:04 PM
Unable to Set the XValues Property of the Series KathyC Charts and Charting in Excel 5 January 4th 07 09:26 PM
Unable to set the XValues property of the Series class Ben Charts and Charting in Excel 7 December 7th 06 10:01 PM
Runtime error 1004 - unable to set Visible property of Worksheet c SueJB Excel Programming 2 October 4th 05 02:27 PM
Error 1004: Unable to set the XValues of the Series Class jonathanmiller Excel Programming 0 June 23rd 04 12:20 AM


All times are GMT +1. The time now is 12:40 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"