|
-
May 6th, 2005, 10:48 AM
#1
Thread Starter
New Member
Excel charts and macro problem
Hi,
I'm able to run my macro perfectly well in the workbook that the macro is contained in. However, when I try to run it in another workbook, the macro does not run. I get a:
Run-time error '1004'
Unable to get the Chart Objects property of the Worksheet class
This is the line highlighted:
ActiveSheet.ChartObjects("Chart 2").Activate
Here is the bunch of code that contains that line:
ActiveChart.Axes(xlValue).Select
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
ActiveWindow.Visible = False
Windows("nmmacrosheet.xls").Activate
Range("A26").Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
Selection.Delete
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).Delete
ActiveChart.SeriesCollection(1).XValues = "=graphs!R2C10:R361C10"
ActiveChart.SeriesCollection(2).XValues = "=graphs!R2C10:R361C10"
I'd appreciate help with this. I'm guessing that it has to do something with the chart and the workbook.
Thanks,
Neil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|