CopyPicture on a Shapes range

  • Thread starter Thread starter Kevin Beckham
  • Start date Start date
K

Kevin Beckham

I have a graph overlaying another and want to copy them together. The
following code snippet worked in Excel 2003

ActiveSheet.Shapes.Range(Array("Chart 27", "Chart 9")).Select
Selection.CopyPicture

but doesn't work now. Has there been a syntax change or is it no longer
supported?

Kevin Beckham
 
xl2007 has trouble with shapes and .select

I'd try:

ActiveSheet.Shapes.Range(Array("Chart 27", "Chart 9")).copypicture

(but I didn't actually try it!)
 
Thanks for the try, but it doesn't work - Error 438 - Object doesn't support
this property or method

Kevin
 
How about:

ActiveSheet.ChartObjects(Array("Chart 27", "Chart 9")).CopyPicture

It worked in xl2003. I didn't test in xl2007.
 
Under xl2007, it gives the following error message: "The item with the
specified name wasn't found"

I re-evaluated what I wanted to do - the solution was to have a single graph
with two different chart types, with secondary axes and a macro to ensure
the xlValues maximum scale was the same for both axes.
 
Further trials showed that
ActiveSheet.Shapes.Range(Array("Chart 27", "Chart 9")).Select
Selection.Copy

does work. It then requires the subsequent paste to use PasteSpecial and to
select Picture (JPEG) or similar (but not the default paste, otherwise the
charts are pasted separately, not as an overlay)
 
Glad you found a workaround.

Kevin said:
Further trials showed that
ActiveSheet.Shapes.Range(Array("Chart 27", "Chart 9")).Select
Selection.Copy

does work. It then requires the subsequent paste to use PasteSpecial and to
select Picture (JPEG) or similar (but not the default paste, otherwise the
charts are pasted separately, not as an overlay)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top