Hi,

I have a template with a number of graphs and when I run my script it is supposed to get the new range of data and sets the series of the graphs to point at the correct data.

My problem is that when the code attempts to access the series I continually receive the following error:
Run-time error '1004'

Unable to set the Xvalues property of the series class
I have looked in the help files but cannot seem to find anything that helps.

Below is some code:
VB Code:
  1. [INDENT]
  2. Dim chrt As Chart, Sc As SeriesCollection
  3.    
  4. Set MyRange = Worksheets("Data_Roll").UsedRange
  5. NoRows = MyRange.Rows.Count  
  6. Set MyRange = Worksheets("Data_Roll").Range("C3:C" & NoRows)
  7.        
  8. Set chrt = Charts("NetProfile")
  9. Set Sc = chrt.SeriesCollection
  10. Sc(1).XValues = MyRange[/INDENT]
Strange thing is that if I create the series manually after I have opened the template the code appears to be able to access the series object. Its as if it can't access the series objects of the series items created when the template was first built.

Does anybody have any ideas why this could be? Is it a permissions problem? Is there a better way to do this?

Any help would be much appreciated.
Many Thanks in advance.