Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Macros between two seprate windows (excel)

What I am trying to do, is to copy a spreadsheet from one Excel window and
paste it into a new window. But when I paste this, I need it to paste it as
a picture, or "Picture (Enhanced Metafile)." When I run this macro I get a
run time error '1004.' How can do this?

Macro:
' Select area

Range("A4:I46").Select
Selection.Copy

' Open new EXCEL SHEET
'
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.

Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft
Office\OFFICE11\EXCEL.EXE", 1)
' Application.Wait (Now + TimeValue("0:00:03"))



'
' Paste IU as picture so that the format is not changed and still contains
boxes
'
'Sheets("Sheet1").Select
Range("A1").Select
'ActiveSheet.Paste
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False

How can I run a macro between two separate excel windows?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macros between two seprate windows (excel)

Patrick,
You are looking at this problem in the wrong manner. It is quite simple.
Have 2 Excel windows open (first open excel make small then open excel again)
in the excel window that has your work in it simply right click on the tab
and make copy moving to the new workbook. should you have any other problems
with this just email me.

"Patrick" wrote:

What I am trying to do, is to copy a spreadsheet from one Excel window and
paste it into a new window. But when I paste this, I need it to paste it as
a picture, or "Picture (Enhanced Metafile)." When I run this macro I get a
run time error '1004.' How can do this?

Macro:
' Select area

Range("A4:I46").Select
Selection.Copy

' Open new EXCEL SHEET
'
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.

Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft
Office\OFFICE11\EXCEL.EXE", 1)
' Application.Wait (Now + TimeValue("0:00:03"))



'
' Paste IU as picture so that the format is not changed and still contains
boxes
'
'Sheets("Sheet1").Select
Range("A1").Select
'ActiveSheet.Paste
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False

How can I run a macro between two separate excel windows?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Macros between two seprate windows (excel)

Patrick,
Do you really need to work with 2 instances of Excel ?
If yes, then use automation instead of Shell.

NickHK

"Patrick" wrote in message
...
What I am trying to do, is to copy a spreadsheet from one Excel "window"

and
paste it into a new "window". But when I paste this, I need it to paste it

as
a picture, or "Picture (Enhanced Metafile)." When I run this macro I get a
run time error '1004.' How can do this?

Macro:
' Select area

Range("A4:I46").Select
Selection.Copy

' Open new EXCEL SHEET
'
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.

Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft
Office\OFFICE11\EXCEL.EXE", 1)
' Application.Wait (Now + TimeValue("0:00:03"))



'
' Paste IU as picture so that the format is not changed and still contains
boxes
'
'Sheets("Sheet1").Select
Range("A1").Select
'ActiveSheet.Paste
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False

How can I run a macro between two separate excel windows?



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
How to use Windows command within Excel macros Tom Excel Discussion (Misc queries) 2 April 20th 10 12:01 AM
Windows Mobile 6.1 Pocket Excel & Macros / VBA Bruno Excel Discussion (Misc queries) 1 July 13th 09 08:45 PM
Running Windows-Excel macros on Macintosh SunTzuComm Excel Programming 2 July 4th 04 12:24 AM
Excel 97 Macros in Later Version of Windows Partho[_2_] Excel Programming 1 June 9th 04 08:51 AM
Macros disabled on all but one of 3 windows in excel ullrich fischer Excel Programming 1 July 21st 03 08:03 PM


All times are GMT +1. The time now is 05:28 AM.

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"