LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Get Workbook path but from another excel instance

I open a rating workbook which, when a userform button is pressed,
opens another instance of excel and runs multiple workbooks that do
many calculations. When this is completed, i want the next part of the
rating code to remember the path for one of the two workbooks that are
left open in the other instance of excel.

When i try looking through the available workbooks, i get:
personal.xls
Book1.xls
rating.xls

These are the workbooks that are open in the 1st instance of excel.
How do i look at the workbooks in the 2nd instance.?
property listing.xls
summary.xls

I thought this code might do it, but just keeps looping through the
1st instance, without moving to the 2nd.
Code:
Do
Set XLAPP = GetObject(, "Excel.Application")
If Not XLAPP Is Nothing Then
For Each wkbk In XLAPP.Workbooks
If wkbk.Name = "Property Listing - " &
UserForm2.ComboBox1.Value & ".xls" Then
wkbk.Saved = True
x = wkbk.Path
wkbk.Close
End If
Next wkbk
End If
Loop


So what i want to do is:
open my rating workbook
press the userform button
have a 2nd instance of excel open
have multiple workbooks open to do calculations, leaving only 2
workbooks remaining

so far so good

have x = the path of the propertylisting workbook

x is in the code of the rating workbook userform and i can't get to
read the workbooks that are in the other instance of excel.

 
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
Force excel to start new instance when I double-click a workbook [email protected][_2_] Excel Discussion (Misc queries) 0 April 30th 09 01:35 PM
find full file path of running excel instance Rama Excel Programming 8 February 12th 07 03:15 PM
Run Macro in another workbook already OPENED in another instance of Excel [email protected] Excel Programming 3 December 27th 06 04:37 AM
How do I get one instance of Excel to communicate with another instance? [email protected] Excel Programming 3 November 21st 06 10:31 PM
Move a workbook from one instance of excel applicaiton to another Alan Excel Programming 2 September 29th 05 04:52 AM


All times are GMT +1. The time now is 11:31 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"