Unable to set the XValues property of the Series class

R

ramkumar_cpt

Hi


I have one sheet. It contains some charts. I want to put th
XValues use macro. But I am unable to run this macro. I got error a
Unable to set the XValues property of the Series class.("Run time erro
1044"). Anybody can help me?

My macro code is:

ActiveWindow.Visible = False
Windows("FullTemplate.xls").Activate
Range("I22").Select
ActiveSheet.ChartObjects("Chart 1031").Activate
ActiveChart.ChartArea.Select
*ActiveChart.SeriesCollection(1).XValues
Worksheets("MonthlyData").Range("B2:B5")*
ActiveChart.SeriesCollection(1).Values
"=MonthlyData!R2C5:MonthlyData!R30C5"


Note: I am using Line chart. Pls help me.



Thanks in advance.

Ram
 
A

Andy Pope

Hi,

Are you sure that was where the code failed.
This line looks the more likely candidate.

ActiveChart.SeriesCollection(1).Values =
"=MonthlyData!R2C5:MonthlyData!R30C5"

try changing the references to,
ActiveChart.SeriesCollection(1).Values = "=MonthlyData!R2C5:R30C5"

Cheers
Andy
 
R

ramkumar_cpt

Hi,

Andy. yes that is my mistake. Now i have corrected that error. Bu
again i got the same error as Unable to set the XValues property o
the Series class.("Run time error 1044"). Pls help me?

This time my coding is:

ActiveSheet.ChartObjects("Chart 1030").Activate
ActiveChart.ChartArea.Select
*ActiveChart.SeriesCollection(1).XValues
"=MonthlyData!R2C1:R30C1"* ActiveChart.SeriesCollection(1).Values
"=MonthlyData!R2C2:R30C2"
ActiveChart.SeriesCollection(2).XValues
"=MonthlyData!R2C1:R30C1"
ActiveChart.SeriesCollection(3).XValues = "=MonthlyData!R2C1:R30C1
 
A

Andy Pope

Does your range contain empty cells?

ramkumar_cpt said:
Hi,

Andy. yes that is my mistake. Now i have corrected that error. But
again i got the same error as Unable to set the XValues property of
the Series class.("Run time error 1044"). Pls help me?

This time my coding is:

ActiveSheet.ChartObjects("Chart 1030").Activate
ActiveChart.ChartArea.Select
*ActiveChart.SeriesCollection(1).XValues =
"=MonthlyData!R2C1:R30C1"* ActiveChart.SeriesCollection(1).Values =
"=MonthlyData!R2C2:R30C2"
ActiveChart.SeriesCollection(2).XValues =
"=MonthlyData!R2C1:R30C1"
ActiveChart.SeriesCollection(3).XValues = "=MonthlyData!R2C1:R30C1"
 
A

Andy Pope

As a test put some values in the empty cells and try your code. It
should work.

Once you have established the problem is empty cells you can experiment
by populating the first empty cell and seeing if the code still works.

Then you need to update your code to check the status of empty cells and
put something in them temporarily so your code runs. Then clear those
cells when finished.

Cheers
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top