VSTO: Cannot open another Excel file while the first file is blocked by a modal from the add-in
We cannot open another Excel file and the first file is locked by a modal from our add-in. Closing the dialog cancels the opening of all pending files.
The version of Excel is 2007. Is there a programmatic work that will allow Microsoft Excel 2007 to open the second file in a separate window while the first window is waiting for an add-in to be retrieved from a modal dialog?
NB: This behavior seems to apply to Excel's own dialog boxes as well.
source to share
I am currently upgrading our application to Excel 2007 and VS 2010 (targeting .NET 4.0) and I noticed that if you are using CustomTaskPane it works on a different thread. I have an addin that creates a taskbar that launches a modal form, and from that form I add a new book. This seems to work without issue. If I run the modal form directly from the add-in, I 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 it. (More on CustomTaskPane: http://msdn.microsoft.com/en-us/library/aa942864(VS.100).aspx )
source to share