LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default copy data code to work with seperate instance of excel

You can try something like this. (untested)

Sub OpenAnotherInstance()

Dim OldApp As Excel.Application
Dim newAPP As Excel.Application
Dim NewWB As Excel.Workbook
Dim oldWB As Excel.Workbook
Dim NewWS As Excel.Worksheet
Dim OldWS As Excel.Worksheet

Set OldApp = Application
Set newAPP = CreateObject(, "Excel.Application")

Set oldWB = ThisWorkbook

'Opeen Workbooks FA Master in NewApp

Set NewWB = newAPP.Workbooks.Open(Filename) 'Where filename is the FA
Master workbook

'If it were me, I'd define the active sheet somehow

Set NewWS = NewWB.Worksheets("SheetName")
Set OldWS = oldWB.Worksheets("SheetName")

NewWS.Range("v19:v20").Copy
OldWS.Range("m3:m4").PasteSpecial xlPasteValues

End Sub

HTH,
Barb Reinhardt
"John" wrote:

Hi this works if both workbooks are open in the same instance... however I
like to view both workbooks at once on two screens... Can this be adapted to
work in a separate instance of excel? Both workbooks will be open when code
runs

Sub copyFA()
Workbooks("FA Master").Activate
Range("v19:v20").Copy
ThisWorkbook.Activate
Range("m3:m4").PasteSpecial xlPasteValues
End Sub

 
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
add two cells from seperate work sheets into a cell on seperate wo lar Excel Worksheet Functions 6 April 27th 10 06:54 PM
Open files in seperate instance Rick Excel Discussion (Misc queries) 0 November 12th 09 11:13 PM
Copy data into new line on seperate sheet? sarah Excel Discussion (Misc queries) 1 May 12th 09 08:11 PM
Does anyone know how I can seperate a post code in my data sheet? gsmcellular Excel Discussion (Misc queries) 3 July 8th 06 01:32 PM
Is it possible to export each row of data to a seperate work book Stacey[_2_] Excel Programming 18 May 15th 04 04:36 AM


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

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"