ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CopyPicture on a Shapes range (https://www.excelbanter.com/excel-programming/415088-copypicture-shapes-range.html)

Kevin Beckham[_3_]

CopyPicture on a Shapes range
 
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

Dave Peterson

CopyPicture on a Shapes range
 
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!)

Kevin Beckham wrote:

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


--

Dave Peterson

Kevin Beckham[_3_]

CopyPicture on a Shapes range
 
Thanks for the try, but it doesn't work - Error 438 - Object doesn't support
this property or method

Kevin

"Dave Peterson" wrote:

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!)

Kevin Beckham wrote:

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


--

Dave Peterson


Dave Peterson

CopyPicture on a Shapes range
 
How about:

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

It worked in xl2003. I didn't test in xl2007.

Kevin Beckham wrote:

Thanks for the try, but it doesn't work - Error 438 - Object doesn't support
this property or method

Kevin

"Dave Peterson" wrote:

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!)

Kevin Beckham wrote:

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


--

Dave Peterson


--

Dave Peterson

Kevin Beckham[_3_]

CopyPicture on a Shapes range
 
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.

"Dave Peterson" wrote:

How about:

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

It worked in xl2003. I didn't test in xl2007.

Kevin Beckham wrote:

Thanks for the try, but it doesn't work - Error 438 - Object doesn't support
this property or method

Kevin

"Dave Peterson" wrote:

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!)

Kevin Beckham wrote:

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

--

Dave Peterson


--

Dave Peterson


Kevin Beckham[_3_]

CopyPicture on a Shapes range
 
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)

"Dave Peterson" wrote:

How about:

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

It worked in xl2003. I didn't test in xl2007.

Kevin Beckham wrote:

Thanks for the try, but it doesn't work - Error 438 - Object doesn't support
this property or method

Kevin

"Dave Peterson" wrote:

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!)

Kevin Beckham wrote:

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

--

Dave Peterson


--

Dave Peterson


Dave Peterson

CopyPicture on a Shapes range
 
Glad you found a workaround.

Kevin Beckham wrote:

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)

"Dave Peterson" wrote:

How about:

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

It worked in xl2003. I didn't test in xl2007.

Kevin Beckham wrote:

Thanks for the try, but it doesn't work - Error 438 - Object doesn't support
this property or method

Kevin

"Dave Peterson" wrote:

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!)

Kevin Beckham wrote:

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

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com