What about the data being replaced? If it contains only non-plottable values
(i.e., blanks or errors) then VBA cannot access the Values and XValues in
order to replace them. This is a problem for XY and Line charts, so you
could temporarily change the series type to Area or Column, change the data
range, and change the chart type back.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______
"Alan" wrote in message
oups.com...
I am trying to allow users to plot data for different products on a
single chart. The macro calculates the data ranges and then assigns
the XValues and Values to the appropriate series of the chart by
overwriting the previously assigned series values. Sometimes the macro
works perfectly and the chart is updated; sometimes I get run-time
error 1004: "Unable to set the XValues property of the series class".
I've checked; the selected data range is correct for each product and
the format of the series value that I am trying to assign is
consistent and is in RC format.
Could anyone give me a hint as to what is happening and how to fix
this?
Regards, Alan