View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter Peter is offline
external usenet poster
 
Posts: 349
Default excel interop: identifying when excel has "initialized"

This is a question about Excel interop. Any insight would be appreciated.

Question:

Is there any way (ie. event, property, hack, etc) to know when Excel has
initialized? I know this is probably not well-defined, but I would define it
as "all addins for the particular Excel process have initialized" since that
is most useful to my situation.

I have looked at a number of the interop capabilities (properties, events,
etc), nothing i have tried works though.

Background:

We are writing a program in .Net 1.1 using C# that targets the Excel 2000
Interop assemblies, but is being tested with Excel 2003 application which has
some 3rd party addins installed.

We have observed:

1) when "new Excel.ApplicationClass()" is used to start a new Excel process,
the addins do not properly initialize.

2) when starting a new Excel process using Process.Start(), the addins
initialize properly if I wait long enough (eg. sleep for 10 seconds to give
them time)

2.1) if I do not wait long enough, race-condition results occur, and the
addins do not initialize. other side effects (multiple excel processes, error
dialogs) also occur depending on situation, number of addins, etc.

2.2) "waiting long enough" is not well-defined since it is unknown the addin
configuration of a given client. also addins can raise dialogs on load which
require user feedback to complete.

Once again, any insight would be appreciated. Thanks.