M
Michael Cierkowski
I am developing a COM addin for Excel and I run into a major issue. This is
probably the strangest thing I have seen. In the OnConnection method I cast
the application object to the type of
Microsoft.Office.Interop.Excel.Application in order to attach some events.
Here is things get strange. If I open Excel then all is ok, my addin loads
and works correctly. If I open an existing document by double clicking my
addin loads but the workbook isn't visible for about 40 seconds and then all
is ok. If I comment out the cast then it works fine. I created a test
project and the only line of code that I added is this in the OnConnection
method:
Microsoft.Office.Interop.Excel.Application test =
(Microsoft.Office.Interop.Excel.Application)application;
and the same thing happens. If I comment this out it works.. now if I don't
comment it out I and I double click an excel workbook to open, Excel will
open with no workbook visible but if I make a dialog box show up (either by
Help - About; File - Open; or programaticly using MessageBox.show. then the
work book becomes visable immediatly.
Please could anyone help on this one.. I am at wits end and am almost out of
hair to pull out.
Michael
probably the strangest thing I have seen. In the OnConnection method I cast
the application object to the type of
Microsoft.Office.Interop.Excel.Application in order to attach some events.
Here is things get strange. If I open Excel then all is ok, my addin loads
and works correctly. If I open an existing document by double clicking my
addin loads but the workbook isn't visible for about 40 seconds and then all
is ok. If I comment out the cast then it works fine. I created a test
project and the only line of code that I added is this in the OnConnection
method:
Microsoft.Office.Interop.Excel.Application test =
(Microsoft.Office.Interop.Excel.Application)application;
and the same thing happens. If I comment this out it works.. now if I don't
comment it out I and I double click an excel workbook to open, Excel will
open with no workbook visible but if I make a dialog box show up (either by
Help - About; File - Open; or programaticly using MessageBox.show. then the
work book becomes visable immediatly.
Please could anyone help on this one.. I am at wits end and am almost out of
hair to pull out.
Michael