Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Please help: C# COM Plug-in not releasing Excel properly when embedded

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_WorkbookO penEventHandler(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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Please help: C# COM Plug-in not releasing Excel properly when embe

Hi, in my opinion, you should omit the + symbol from the += statement. I hope
this helps you.

"Fredrik" wrote:

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_WorkbookO penEventHandler(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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Plug-ins S West Excel Discussion (Misc queries) 0 October 15th 08 03:34 AM
Map Point Plug-in for Excel 2007 Tim Cesario Excel Discussion (Misc queries) 0 January 24th 08 04:58 PM
not releasing excel objects..pl see this simple code. asp newbie Excel Programming 0 May 22nd 06 03:57 PM
optimization plug-in for Excel 2003. AG Excel Worksheet Functions 2 October 5th 05 06:59 AM
Problem with Excel plug-in R Oprea Excel Programming 0 October 5th 04 04:06 AM


All times are GMT +1. The time now is 10:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"