Saturday, September 8, 2012

Copying Multiple Charts as a Picture in Excel 2007

Using this technique throws an 'Application-defined or object-defined error' on the CopyPicture line.

ActiveSheet.ChartObjects.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Sheets("Sheet2").Paste
 
ActiveSheet.ChartObjects.Copy    
Sheets("Sheet2").PasteSpecial Format:="Picture (Enhanced Metafile)", Link:=False, DisplayAsIcon:=False
 
 
However,  If I use the chart as a Shape object it works.
   
ActiveSheet.Shapes("Chart 6").CopyPicture Appearance:=xlScreen, Format:=xlPicture
Sheets("Sheet2").Paste

This also works
ActiveSheet.Shapes("Chart 6").Copy
Sheets
("Sheet2").PasteSpecial Format:="Picture (Enhanced Metafile)", Link:=False, DisplayAsIcon:=False
 

No comments: