views:

133

answers:

2

We can't open another Excel file, while first file is blocked by modal window from our Add-in. Closing the dialog window unfreezes all pending file opens.

Excel version is 2007. Is there a programmatic work around, that would allow Microsoft Excel 2007 to open the second file in a separate window, while first window is waiting for the Add-in to get out of the modal dialog window?

NB: it seems that this behavior applies to Excel's own dialog windows as well.

+1  A: 

No- it's an architectural limitation of the way Excel's automation server is written. There's only one thread servicing the automation queue- if Excel is at the top of the call stack and anything is blocking lower down, new calls to the automation server are queued until it comes back.

nitzmahone
Thanks for the explanation!
Rinat Abdullin
A: 

I'm currently upgrading our application to Excel 2007 and VS 2010 (targeting .NET 4.0) and I did notice that you if you are using a CustomTaskPane, it seems to be running on a different thread. I have an addin that creates a task pane which launches a modal form and from that form I add a new workbook. It seems to work without a problem. If I launch the modal form directly from the addin I do get the same problem you described. I'm not sure if this will work in .NET 3.5 or 2.0 but it's worth a shot. (More on CustomTaskPane: http://msdn.microsoft.com/en-us/library/aa942864%28VS.100%29.aspx)

Erick