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: 37
Default Reference multiple Instances of Excel

How to find and reference multiple Instances of Excel

This has been discussed several times in this ng, but I
cannot find a solution (apologies if I've have missed it).

John (jaf) posted some code he
http://tinyurl.com/6e78t

Arriving at his "MyGetXl()" looked promising, but on
further testing:
Set oxl = GetObject(MyFileName)
only works if MyFileName is an unsaved file named Bookx
(in first the window of the given instance),
or,
it could be a saved file if in the Instance of XL that is
running the code.

One could achieve as much, without any API's, with
something like this:

For i = 1 to say 20
Set oxl = GetObject("Book" & i)
' test for this and that, then reference oxl.Parent
Next

So, if every instance had an unsaved file "Bookx" it would
be very easy. An addin could Add a new wb and hide it on
startup - doable but not nice.


http://support.microsoft.com/?kbid=238975

The "Note" in this article in part reads:
....you cannot attach to any instance except for the
first. However, because Office applications also
register their documents in the ROT, you can successfully
attach to other instances by iterating the ROT looking for
a specific document, attaching to this document, and then
getting the Application object from this document.
(links to a C++ method which I cannot follow)

If a document is found, say with John's method or
enumerating windows XLMAIN XLDESK EXCEL7, does anyone
have an idea how to attach to this document, with which to
reference it's parent instance?

TIA,
Sandy
savituk yahoo co uk
 
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
Multiple instances of Excel (Multiple workbooks) Shane Setting up and Configuration of Excel 3 November 13th 09 05:07 PM
Using RTD with multiple instances of excel [email protected] Excel Discussion (Misc queries) 0 February 13th 09 10:51 AM
Multiple Instances of Excel David Z Excel Discussion (Misc queries) 18 July 1st 06 02:26 PM
Multiple instances of Excel Carol Crowley Excel Discussion (Misc queries) 9 March 17th 06 06:18 PM
Multiple instances of Excel and VB Rich[_16_] Excel Programming 2 September 19th 03 07:59 AM


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