Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Manipulate GIF that has been inserted using Paste Special

The following code is designed to copy 2 charts from one sheet and pastes
them as a picture onto another sheet.

How do I assign the pasted picture to a variable so that I can manipulate it
(i.e. change the location, width, etc)

The following code does not work (throws an "Object Required" error on 'Set
myObj =')

Any ideas?

Sub testMe3()
Worksheets("Graph").Select
ActiveWindow.Visible = False
Windows("Report_Aug06.xls").Activate
Sheets("Graph").Shapes.Range(Array("Chart 40", "Chart 43")).Select

Selection.Copy

Worksheets("Instructions").Select
Range("A97").Select

Dim myObj As Shape 'As Object

Set myObj = ActiveSheet.PasteSpecial(Format:="Picture (Enhanced
Metafile)", Link:=False, DisplayAsIcon:=False)
Debug.Print TypeName(myObj) & " - " & myObj
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Manipulate GIF that has been inserted using Paste Special

Hi,

The pastespecial does not return a object reference. So use the shape
collection to rename the latest item.

ActiveSheet.PasteSpecial _
Format:="Picture (Enhanced Metafile)", Link:=False, DisplayAsIcon:=False
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Name = "NewName"

Cheers
Andy

Andibevan wrote:
The following code is designed to copy 2 charts from one sheet and pastes
them as a picture onto another sheet.

How do I assign the pasted picture to a variable so that I can manipulate it
(i.e. change the location, width, etc)

The following code does not work (throws an "Object Required" error on 'Set
myObj =')

Any ideas?

Sub testMe3()
Worksheets("Graph").Select
ActiveWindow.Visible = False
Windows("Report_Aug06.xls").Activate
Sheets("Graph").Shapes.Range(Array("Chart 40", "Chart 43")).Select

Selection.Copy

Worksheets("Instructions").Select
Range("A97").Select

Dim myObj As Shape 'As Object

Set myObj = ActiveSheet.PasteSpecial(Format:="Picture (Enhanced
Metafile)", Link:=False, DisplayAsIcon:=False)
Debug.Print TypeName(myObj) & " - " & myObj
End Sub



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
Special Pasting Quattro Pro 9 file as bitmap, how to manipulate now? jbclem New Users to Excel 1 February 16th 07 09:32 AM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
How do I capture user paste action and convert to Paste Special DonC Excel Programming 0 November 19th 04 01:43 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM


All times are GMT +1. The time now is 12:08 PM.

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

About Us

"It's about Microsoft Excel"