View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default Problems with ChartObjects

"pwermuth" wrote in
message ...
When I run the following line of code:
Worksheets(destinationSheet).ChartObjects(chartToC opy).Activate
where destinationSheet is a string with the name of the sheet "Output
2", and chartToCopy is also a string with the name of a chart "char 11"
I get a "Run-time error '1004':
Unable to get the ChartObjects property of the Worksheet class."


My guess is you have an incorrect name in either your destinationSheet
or chartToCopy variable. Try hard-coding the names directly into the line of
code above and see if it works properly that way. If so, one variable or the
other has the wrong name in it (or if there are multiple worksheets with
chart objects on them you may have the name of a worksheet with the name of
a chart object that's located on a different worksheet).

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm