Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying all charts as enhanced metafiles

I have a sheet with a number of charts. I want to copy them to another sheet
as a single picture. The following code works, but the picture loses
resolution.

'Copies graphs as picture
Sheets("Graphs").Select
Range("A1:R51").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Range("A1").Select


'Pastes graph picture to summary sheet
Sheets("Static Summary Sheet").Select
Range("A1").Select
ActiveSheet.Paste

I have replaced the code with:

'Copies graphs as picture
Sheets("Graphs").Select
ActiveSheet.Shapes.SelectAll
Selection.Copy
Range("A1").Select


'Pastes graph picture to summary sheet
Sheets("Static Summary Sheet").Select
Range("D5").Select
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False
Selection.Top = 69.75
Selection.Left = 37.5

Now I get an error in the pastespecial line "PasteSpecial method of
Worksheet class failed.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default copying all charts as enhanced metafiles

I added two picture to a worksheet and used your code without any problems.
I'm using excel 2003.

Try the same thing. Add two pictures to a blank workbook and see if it
works. the code is good. Are both your sheets worksheets? You called one a
chart so was it created by adding a chart?



"Paste charts as enchanced metafile" wrote:

I have a sheet with a number of charts. I want to copy them to another sheet
as a single picture. The following code works, but the picture loses
resolution.

'Copies graphs as picture
Sheets("Graphs").Select
Range("A1:R51").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Range("A1").Select


'Pastes graph picture to summary sheet
Sheets("Static Summary Sheet").Select
Range("A1").Select
ActiveSheet.Paste

I have replaced the code with:

'Copies graphs as picture
Sheets("Graphs").Select
ActiveSheet.Shapes.SelectAll
Selection.Copy
Range("A1").Select


'Pastes graph picture to summary sheet
Sheets("Static Summary Sheet").Select
Range("D5").Select
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False
Selection.Top = 69.75
Selection.Left = 37.5

Now I get an error in the pastespecial line "PasteSpecial method of
Worksheet class failed.

Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default copying all charts as enhanced metafiles

I should add the loss of resolution is in Excel2007 and the error in the
second code is also in Excel2007. Both methods work fine in Excel2003.

"Paste charts as enchanced metafile" wrote:

I have a sheet with a number of charts. I want to copy them to another sheet
as a single picture. The following code works, but the picture loses
resolution.

'Copies graphs as picture
Sheets("Graphs").Select
Range("A1:R51").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Range("A1").Select


'Pastes graph picture to summary sheet
Sheets("Static Summary Sheet").Select
Range("A1").Select
ActiveSheet.Paste

I have replaced the code with:

'Copies graphs as picture
Sheets("Graphs").Select
ActiveSheet.Shapes.SelectAll
Selection.Copy
Range("A1").Select


'Pastes graph picture to summary sheet
Sheets("Static Summary Sheet").Select
Range("D5").Select
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False
Selection.Top = 69.75
Selection.Left = 37.5

Now I get an error in the pastespecial line "PasteSpecial method of
Worksheet class failed.

Any ideas?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel graphs change when pasted into Publisher - Metafiles change? Ericd1 Charts and Charting in Excel 0 February 1st 10 01:57 AM
SUMPRODUCT - enhanced formula carol Excel Discussion (Misc queries) 1 July 21st 08 04:05 PM
Enhanced lottery question Brad Excel Discussion (Misc queries) 5 April 18th 08 07:21 PM
Enhanced Inputbox John Svendsen Excel Programming 1 September 12th 07 04:12 PM
enhanced conditional formatting Stuart Excel Discussion (Misc queries) 13 November 13th 05 07:20 PM


All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"