Hi
Sure enough your posted code "as is" won't even work under excel 2003, that's because:
chart.Chart.SetSourceData Source:=ActiveSheet.Range("A1:FA6")
has to be:
chartt.Chart.SetSourceData Source:=ActiveSheet.Range("A1:FA6")
Otherwise you walk on thin ice: You're using the chart's name given by excel. Excel itself names chart according to the number of charts within a Sheet, for the first chart the name will be "Chart 1". Now regardless if the first chart still exists, the next chart created will be called "Chart 2". - and so on...
So just check the name of the chart to be modified, if it's indeed "Chart 1" if not so you will have to rename the chart, or correct your code.
See if the error renames, in case tell me which line of the code is marked by the debugger. But maybe above already helped!
|