Prevent multiple instances of Excel from starting
I suppose if you are administrating use of Excel in your organisation it
might be OK for you to close your colleagues' Excel instances in an orderly
way. But if that's not the case my "thought", as you asked, would be don't
even consider doing that!
In your OP you said "I develop under excel and use an interface to a
thrid party middleware product"
I don't follow the reason you need to close all but one instance, and the
criteria by which you would leave a given instance open.
If you know the FullName (not simply file name) of a particular file that's
of interest, if open it's normally possible to attach a ref to its instance
with GetObject(FullName).Parent.
Or maybe just start your own instance.
Regards,
Peter T
"Robert Mulroney" '''' wrote in message
...
Thanks guys. I've explored some options that use the Windows API to check
the list of running processes. I don't really want to give my users the
capability to run scripts that simply terminate processes. That could lead
to
some, well.... "problems".
I've noticed that a lot of objects in excel have an "Application"
property.
There must be someway that I can compare "Applications" for each open
document and terminate all but one using the "Application.Quit". That
seems a
little safer to me.
Any thoughts?
- Rm
|