F
Fredrik
Hello!
Some of you have seen this question before, but I still haven't got a
solution to my problem, and it's getting rather critical - my
customers are complaining...
My plugin implements IDTExtensibility2. If I leave the stubs
(OnConnection, OnDisconnection, etc) empty, I can open an Excel-
document embedded in Internet Explorer, and when I leave the page,
such as clicking Back, Excel will close-down. So far so good.
However, my plugin must listen to the WorkbookOpen event. I hook it up
in OnStartupComplete, like so:
applicationObject.WorkbookOpen += new
Microsoft.Office.Interop.Excel.AppEvents_WorkbookOpenEventHandler(applicationObject_WorkbookOpen);
But now, even if I leave the applicationObject_WorkbookOpen event-
handler empty, this makes Excel running like an orphaned process, when
I leave the IE page.
I am pretty aware of COM reference counting etc, but I can't figure
out a way to have an event-handler hooked up (which requires a
reference to Excel.Application) and still being able to close down
Excel when the user leaves the IE page.
Any ideas? I'm using Office XP and .NET 1.1
/Fredrik
Some of you have seen this question before, but I still haven't got a
solution to my problem, and it's getting rather critical - my
customers are complaining...
My plugin implements IDTExtensibility2. If I leave the stubs
(OnConnection, OnDisconnection, etc) empty, I can open an Excel-
document embedded in Internet Explorer, and when I leave the page,
such as clicking Back, Excel will close-down. So far so good.
However, my plugin must listen to the WorkbookOpen event. I hook it up
in OnStartupComplete, like so:
applicationObject.WorkbookOpen += new
Microsoft.Office.Interop.Excel.AppEvents_WorkbookOpenEventHandler(applicationObject_WorkbookOpen);
But now, even if I leave the applicationObject_WorkbookOpen event-
handler empty, this makes Excel running like an orphaned process, when
I leave the IE page.
I am pretty aware of COM reference counting etc, but I can't figure
out a way to have an event-handler hooked up (which requires a
reference to Excel.Application) and still being able to close down
Excel when the user leaves the IE page.
Any ideas? I'm using Office XP and .NET 1.1
/Fredrik