multiple instances

S

sali

usualy, all active [open] workbooks belong to the *same* excel app instance,
but sometimes [for example, when working with dbf files] dbf files appear to
be opened in *new* instance, not in one allready running, so i can not share
macros contained in that other excel instance.

this usualy happens when excel file opened with "start file.dbf", when
opened from excel app with "ope ..." it is ok.

i am interested is there some way to examine is there multiple ecxel app
instances, and how to access files of one instance from another [especially
when invoking macros or addressing cells in formulas]?

thnx
 
D

Dave Peterson

Sometimes one of these works:

Tools|Options|General|Ignore other applications (uncheck it)

--- or ---

Close Excel and
Windows Start Button|Run
excel /unregserver
then
Windows Start Button|Run
excel /regserver

The /unregserver & /regserver stuff resets the windows registry to excel's
factory defaults.

But when I start excel via the windows start button, I always get another
instance.
usualy, all active [open] workbooks belong to the *same* excel app instance,
but sometimes [for example, when working with dbf files] dbf files appear to
be opened in *new* instance, not in one allready running, so i can not share
macros contained in that other excel instance.

this usualy happens when excel file opened with "start file.dbf", when
opened from excel app with "ope ..." it is ok.

i am interested is there some way to examine is there multiple ecxel app
instances, and how to access files of one instance from another [especially
when invoking macros or addressing cells in formulas]?

thnx
 
S

sali

i've just noticed that "sometimes" i have multiple instances, wasn't aware
of exact steps to replicte behaviour.

if that behaviour is completely legal, is there some mean to obtain
communication between multiple instances?

thnx

Dave Peterson said:
Sometimes one of these works:

Tools|Options|General|Ignore other applications (uncheck it)

--- or ---

Close Excel and
Windows Start Button|Run
excel /unregserver
then
Windows Start Button|Run
excel /regserver

The /unregserver & /regserver stuff resets the windows registry to excel's
factory defaults.

But when I start excel via the windows start button, I always get another
instance.
usualy, all active [open] workbooks belong to the *same* excel app instance,
but sometimes [for example, when working with dbf files] dbf files appear to
be opened in *new* instance, not in one allready running, so i can not share
macros contained in that other excel instance.

this usualy happens when excel file opened with "start file.dbf", when
opened from excel app with "ope ..." it is ok.

i am interested is there some way to examine is there multiple ecxel app
instances, and how to access files of one instance from another [especially
when invoking macros or addressing cells in formulas]?

thnx
 
D

Dave Peterson

I've never seen a way to reliably do it.
i've just noticed that "sometimes" i have multiple instances, wasn't aware
of exact steps to replicte behaviour.

if that behaviour is completely legal, is there some mean to obtain
communication between multiple instances?

thnx

Dave Peterson said:
Sometimes one of these works:

Tools|Options|General|Ignore other applications (uncheck it)

--- or ---

Close Excel and
Windows Start Button|Run
excel /unregserver
then
Windows Start Button|Run
excel /regserver

The /unregserver & /regserver stuff resets the windows registry to excel's
factory defaults.

But when I start excel via the windows start button, I always get another
instance.
usualy, all active [open] workbooks belong to the *same* excel app instance,
but sometimes [for example, when working with dbf files] dbf files appear to
be opened in *new* instance, not in one allready running, so i can not share
macros contained in that other excel instance.

this usualy happens when excel file opened with "start file.dbf", when
opened from excel app with "ope ..." it is ok.

i am interested is there some way to examine is there multiple ecxel app
instances, and how to access files of one instance from another [especially
when invoking macros or addressing cells in formulas]?

thnx
 
D

Dave Peterson

But there may be a way to do this. Maybe someone who knows windows APIs will
chime in.

Dave said:
I've never seen a way to reliably do it.
i've just noticed that "sometimes" i have multiple instances, wasn't aware
of exact steps to replicte behaviour.

if that behaviour is completely legal, is there some mean to obtain
communication between multiple instances?

thnx

Dave Peterson said:
Sometimes one of these works:

Tools|Options|General|Ignore other applications (uncheck it)

--- or ---

Close Excel and
Windows Start Button|Run
excel /unregserver
then
Windows Start Button|Run
excel /regserver

The /unregserver & /regserver stuff resets the windows registry to excel's
factory defaults.

But when I start excel via the windows start button, I always get another
instance.

sali wrote:

usualy, all active [open] workbooks belong to the *same* excel app instance,
but sometimes [for example, when working with dbf files] dbf files appear to
be opened in *new* instance, not in one allready running, so i can not share
macros contained in that other excel instance.

this usualy happens when excel file opened with "start file.dbf", when
opened from excel app with "ope ..." it is ok.

i am interested is there some way to examine is there multiple ecxel app
instances, and how to access files of one instance from another [especially
when invoking macros or addressing cells in formulas]?

thnx
 
P

Peter T

Dave Peterson said:
But there may be a way to do this. Maybe someone who knows windows APIs will
chime in.

I looked into this a while ago, I'm not aware of any API's that directly do
that though API's assist in the overall process.

If a workbook is uniquely open in a given instance then the following
normally works

set xlApp = GetObject(sFullname).Parent

This of course requires one instance knows the fullname of some file (even
an addin) uniquely open in another instance. If this scenario applies to the
OP it might be pretty straightforward, depending on which instance is
required to control the other and assuming it can be determined there will
be multiple instances running.

My generic method of referencing all unknown instances goes something like
this -

Enumerate windows (API) and get all Excel window handles. At the same time
get the names of any unsaved BookX in each instance - "X" will be a unique
number.

If an instance does not include an unsaved BookX - bring the instance to the
top (API) and add a new workbook with DDE using (say) Word, hide the new
BookX for future use.

With GetObject BookX set an array of xlApp refs & withevents class's to each
instance.

Regards,
Peter T

Dave said:
I've never seen a way to reliably do it.
i've just noticed that "sometimes" i have multiple instances, wasn't aware
of exact steps to replicte behaviour.

if that behaviour is completely legal, is there some mean to obtain
communication between multiple instances?

thnx


Sometimes one of these works:

Tools|Options|General|Ignore other applications (uncheck it)

--- or ---

Close Excel and
Windows Start Button|Run
excel /unregserver
then
Windows Start Button|Run
excel /regserver

The /unregserver & /regserver stuff resets the windows registry to excel's
factory defaults.

But when I start excel via the windows start button, I always get another
instance.

sali wrote:

usualy, all active [open] workbooks belong to the *same* excel app
instance,
but sometimes [for example, when working with dbf files] dbf files
appear to
be opened in *new* instance, not in one allready running, so i can not
share
macros contained in that other excel instance.

this usualy happens when excel file opened with "start file.dbf", when
opened from excel app with "ope ..." it is ok.

i am interested is there some way to examine is there multiple ecxel app
instances, and how to access files of one instance from another
[especially
when invoking macros or addressing cells in formulas]?

thnx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top