How do I isolate my Excel Server from the user's general Excel environment?
"Joseph Geretz" wrote in message
...
I'm trying to use Excel as an automation server form within my own
application, but I'm finding it very difficult to keep my own instance of
Excel isolated from the user's general Excel environment. I've found the
basic setting 'Ignore other Applications' (I forget the programmatic
property, and I don't have my code in front of me right now) which keeps
my
copy of Excel isolated form any Workbooks / Excel instances that the user
may open from the windows shell. However this does have a rather nasty
side
effect - it prevents workbooks from being opened by simply double-clicking
them from the windows shell. Presumably, by directing Excel to ignore DDE
requests (DDE - and this is 2006 :-\ ) it sets up Excel to ignore DDE
requests from the windows shell.
What the @$##$^% has Microsoft done here? How can Excel be taken seriously
as an automation server, if we can't create an isolated instance which
doesn't wack out and doesn't get wacked out by other instances of Excel??
This is Windows after all. The OS which is suppoed to support more than
one
thing going on at any given time.
Just thinking out loud here, so feel free to shoot me down in flames if I've
over-simplified things, but how about hooking the Workbook_Open event in
your Server instance? You can then check if the workbook being opened is
'authorised' (i.e. has been instructed to open by the server itself). If it
is unknown, assume it has been instructed to open via DDE, get it's fullname
property, immediately close it and then re-open it via the ShellExecute API.
Robert
|