Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Excel Macro Help for Charts

I am getting an error message when trying to have a macro create a
chart. The following is my error message:

Run-Time Error '1004'
Unbale to set the xValue property of the Seris class

The following is my code:

Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet4!C9,C16,C24)"
ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"

All of my cells is sheet4 have valid data. I am not sure what I am
doing wrong. The should be created in sheet5
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Excel Macro Help for Charts

Hi,
Use R1C1 notation instead of A1 notation.
Your line will then look like this:
ActiveChart.SeriesCollection(1).XValues =
"=(Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1)"

R8C1 refers to cell A8 - rows and columns are reversed
The next lines in your code need to be modified too.
rgds,
Lazzzx

skrev i meddelelsen
...
I am getting an error message when trying to have a macro create a
chart. The following is my error message:

Run-Time Error '1004'
Unbale to set the xValue property of the Seris class

The following is my code:

Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet4!C9,C16,C24)"
ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"

All of my cells is sheet4 have valid data. I am not sure what I am
doing wrong. The should be created in sheet5


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Excel Macro Help for Charts

On Jan 16, 4:41*pm, "Lazzzx" wrote:
Hi,
Use R1C1 notation instead of A1 notation.
Your line will then look like this:
* * *ActiveChart.SeriesCollection(1).XValues =
"=(Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1)"

R8C1 refers to cell A8 - rows and columns are reversed
The next lines in your code need to be modified too.
rgds,
Lazzzx

skrev i ...



I am getting an error message when trying to have a macro create a
chart. *The following is my error message:


Run-Time Error '1004'
Unbale to set the xValue property of the Seris class


The following is my code:


Charts.Add
* *ActiveChart.ChartType = xlLineMarkers
* *ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
* *ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
* * * *PlotBy:=xlColumns
* * ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
* * ActiveChart.SeriesCollection(1).Values = _
* * * *"=(Sheet4!C9,C16,C24)"
* *ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"


All of my cells is sheet4 have valid data. *I am not sure what I am
doing wrong. *The should be created in sheet5- Hide quoted text -


- Show quoted text -


I tried that it that did not work for some reason or another
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Excel Macro Help for Charts

On Jan 16, 5:07*pm, wrote:
On Jan 16, 4:41*pm, "Lazzzx" wrote:





Hi,
Use R1C1 notation instead of A1 notation.
Your line will then look like this:
* * *ActiveChart.SeriesCollection(1).XValues =
"=(Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1)"


R8C1 refers to cell A8 - rows and columns are reversed
The next lines in your code need to be modified too.
rgds,
Lazzzx


skrev i ...


I am getting an error message when trying to have a macro create a
chart. *The following is my error message:


Run-Time Error '1004'
Unbale to set the xValue property of the Seris class


The following is my code:


Charts.Add
* *ActiveChart.ChartType = xlLineMarkers
* *ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
* *ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
* * * *PlotBy:=xlColumns
* * ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
* * ActiveChart.SeriesCollection(1).Values = _
* * * *"=(Sheet4!C9,C16,C24)"
* *ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"


All of my cells is sheet4 have valid data. *I am not sure what I am
doing wrong. *The should be created in sheet5- Hide quoted text -


- Show quoted text -


I tried that it that did not work for some reason or another- Hide quoted text -

- Show quoted text -


I made the change, but I still get the same error


Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!R8C1:R15C1)"
',A23)"
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet4!R3C3:R9C3)" 'C9,C16,C24)"
ActiveChart.SeriesCollection(1).Name = "=Sheet4!R2C1"

I decided to try to use a continuous range to make sure that there was
data and it still did not work

Thank you for your help

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Excel Macro Help for Charts

On Jan 16, 5:11*pm, wrote:
On Jan 16, 5:07*pm, wrote:





On Jan 16, 4:41*pm, "Lazzzx" wrote:


Hi,
Use R1C1 notation instead of A1 notation.
Your line will then look like this:
* * *ActiveChart.SeriesCollection(1).XValues =
"=(Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1)"


R8C1 refers to cell A8 - rows and columns are reversed
The next lines in your code need to be modified too.
rgds,
Lazzzx


skrev i ...


I am getting an error message when trying to have a macro create a
chart. *The following is my error message:


Run-Time Error '1004'
Unbale to set the xValue property of the Seris class


The following is my code:


Charts.Add
* *ActiveChart.ChartType = xlLineMarkers
* *ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
* *ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
* * * *PlotBy:=xlColumns
* * ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
* * ActiveChart.SeriesCollection(1).Values = _
* * * *"=(Sheet4!C9,C16,C24)"
* *ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"


All of my cells is sheet4 have valid data. *I am not sure what I am
doing wrong. *The should be created in sheet5- Hide quoted text -


- Show quoted text -


I tried that it that did not work for some reason or another- Hide quoted text -


- Show quoted text -


I made the change, but I still get the same error

Charts.Add
* * ActiveChart.ChartType = xlLineMarkers
* * ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
* * ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
* * * * PlotBy:=xlColumns
* * *ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!R8C1:R15C1)"
',A23)"
* * *ActiveChart.SeriesCollection(1).Values = _
* * * * "=(Sheet4!R3C3:R9C3)" 'C9,C16,C24)"
* * ActiveChart.SeriesCollection(1).Name = "=Sheet4!R2C1"

I decided to try to use a continuous range to make sure that there was
data and it still did not work

Thank you for your help- Hide quoted text -

- Show quoted text -


I am still stuck. I tried to match the rows to see if that was the
issue and that did not work

Here is my modified code

'ActiveSheet.ChartObjects.Delete
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!R9C1,Sheet4!
R16C1,Sheet4!R24C1)" ',A23)"
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet4!R9C3,Sheet4!R16C3,Sheet4!R24C3)" 'C9,C16,C24)"
ActiveChart.SeriesCollection(1).Name = "=Sheet4!R2C1"

Thank you


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Excel Macro Help for Charts

Try this:

ActiveChart.SeriesCollection(1).XValues = _
"=Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1"
ActiveChart.SeriesCollection(1).Values = _
"=Sheet4!R8C3,Sheet4!R15C3,Sheet4!R23C3"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
...
I am getting an error message when trying to have a macro create a
chart. The following is my error message:

Run-Time Error '1004'
Unbale to set the xValue property of the Seris class

The following is my code:

Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet4!C9,C16,C24)"
ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"

All of my cells is sheet4 have valid data. I am not sure what I am
doing wrong. The should be created in sheet5



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Excel Macro Help for Charts

On Jan 16, 7:46*pm, "Jon Peltier"
wrote:
Try this:

* * ActiveChart.SeriesCollection(1).XValues = _
* * * * "=Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1"
* * ActiveChart.SeriesCollection(1).Values = _
* * * * "=Sheet4!R8C3,Sheet4!R15C3,Sheet4!R23C3"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

wrote in message

...



I am getting an error message when trying to have a macro create a
chart. *The following is my error message:


Run-Time Error '1004'
Unbale to set the xValue property of the Seris class


The following is my code:


Charts.Add
* *ActiveChart.ChartType = xlLineMarkers
* *ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
* *ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
* * * *PlotBy:=xlColumns
* * ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
* * ActiveChart.SeriesCollection(1).Values = _
* * * *"=(Sheet4!C9,C16,C24)"
* *ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"


All of my cells is sheet4 have valid data. *I am not sure what I am
doing wrong. *The should be created in sheet5- Hide quoted text -


- Show quoted text -


I just tried that and that did not work. I am not sure what I am
doing wrong
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Excel Macro Help for Charts

Post on top, like most of the folks here do, to make reading the thread
easier.

Describe "did not work". Did you get an error? What was the error message
(the error number is generally useless)? On what line?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
...
On Jan 16, 7:46 pm, "Jon Peltier"
wrote:
Try this:

ActiveChart.SeriesCollection(1).XValues = _
"=Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1"
ActiveChart.SeriesCollection(1).Values = _
"=Sheet4!R8C3,Sheet4!R15C3,Sheet4!R23C3"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

wrote in message

...



I am getting an error message when trying to have a macro create a
chart. The following is my error message:


Run-Time Error '1004'
Unbale to set the xValue property of the Seris class


The following is my code:


Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet4!C9,C16,C24)"
ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"


All of my cells is sheet4 have valid data. I am not sure what I am
doing wrong. The should be created in sheet5- Hide quoted text -


- Show quoted text -


I just tried that and that did not work. I am not sure what I am
doing wrong


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Excel Macro Help for Charts

Also, don't give up on the other post, started a few hours earlier than
this. I provided some code to make the data selection more general.

Is it possible to redesign the worksheet to use contiguous ranges? Either
rearrange the existing data range or set up a second range, linked to the
first, which connects the cells of interest. Spending five minutes with the
data will save five hours of aggravation.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Jon Peltier" wrote in message
...
Post on top, like most of the folks here do, to make reading the thread
easier.

Describe "did not work". Did you get an error? What was the error message
(the error number is generally useless)? On what line?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
...
On Jan 16, 7:46 pm, "Jon Peltier"
wrote:
Try this:

ActiveChart.SeriesCollection(1).XValues = _
"=Sheet4!R8C1,Sheet4!R15C1,Sheet4!R23C1"
ActiveChart.SeriesCollection(1).Values = _
"=Sheet4!R8C3,Sheet4!R15C3,Sheet4!R23C3"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

wrote in message

...



I am getting an error message when trying to have a macro create a
chart. The following is my error message:


Run-Time Error '1004'
Unbale to set the xValue property of the Seris class


The following is my code:


Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Location Whe=xlLocationAsObject, Name:="Sheet5"
ActiveChart.SetSourceData
Source:=Sheets("Sheet4").Range("A3:A23,C3:C23"), _
PlotBy:=xlColumns
ActiveChart.SeriesCollection(1).XValues = "=(Sheet4!A8,A15,A23)"
ActiveChart.SeriesCollection(1).Values = _
"=(Sheet4!C9,C16,C24)"
ActiveChart.SeriesCollection(1).Name = "=Sheet4!A2"


All of my cells is sheet4 have valid data. I am not sure what I am
doing wrong. The should be created in sheet5- Hide quoted text -


- Show quoted text -


I just tried that and that did not work. I am not sure what I am
doing wrong



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
Excel Macro for Charts [email protected] Excel Programming 1 January 17th 08 05:04 PM
Macro to copy Excel charts to existing Powerpoint file [email protected] Excel Programming 1 September 18th 06 08:32 PM
VBA Code, My excel macro creates the charts on top of each other osman[_5_] Excel Programming 3 July 24th 06 09:53 PM
Creating a macro to copy a number of charts from Excel to PPT Brian Excel Programming 0 December 16th 05 04:53 PM
Global macro for resizing and reformatting Excel charts Sol Apache Excel Programming 5 October 24th 05 03:31 AM


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