View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Maintain integrity of Excel instances

Hi Tom,

Okay, then I think maybe I was confused by opening other files in the
"coded" instance, then when it closed it of course closed all open files in
that instance, but I was thinking the secondary files were opened in a
separate instance.

But for clarity, what do you mean by pseudo code? - like running VBA from a
VBScript or bat file?

Thanks for reply and clarifying...

"Tom Ogilvy" wrote:

Unless you are showing pseudo code, the code you show would only run in and
affect a single instance of excel and that is the instance where the code is
running.

--
Regards,
Tom Ogilvy



"XP" wrote:

Using Office 2003 and Windows XP;

This seems odd to me, but it seems that sometimes Application.Quit will shut
down a second running instance of Excel. I haven't thoroughly tested when
this occurs.
Am I just mistaken and/or confused having more than one instance running or
is this by design based on which instance happens to be active when the code
runs?

Is there a way to ensure the desired effect by returning a reference to the
current instance and quit only that one? Is it possible to use something like:

ThisWorkbook.Application.Quit

Could someone please help me out with some example code and discussion on
this?

Thanks much in advance for your assistance.