LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Excel References Not Release When IDTExtensibility2 Used

My C# add-in implements IDTExtensibility2. As long as I don't sync my
add-in to any Excel events, it works perfectly and the Excel instance
is removed when Excel is shut down.

However, my add-in must listen to some Excel events. I hook them up
during OnConnection, like so (using any of the Excel Workbook events
gives the same problem):
applicationObject.WorkbookOpen += new
Microsoft.Office.Interop.Excel.AppEvents_WorkbookO penEventHandler(applicationObject_WorkbookOpen);
Once I add this line of code, the Excel instance sticks around, even
after Excel is terminated and released. Removing the delegate from
the event (and releaseing the COM reference) in the OnDisconnection
method does not help.

Using .Net 2.0 and the issue exists with at least Office XP and 2003.

The code used to test the creation and release of the Excel instance
is he
Sub Test()
Set oXL = CreateObject("Excel.Application")
Set WBs = oXL.Workbooks
Set Wkbk = WBs.Add
Set Wkbk = Nothing
Set WBs = Nothing
oXL.Quit
Set oXL = Nothing
End Sub

 
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
Add-in with IDTExtensibility2 and worksheet formulae Lars[_4_] Excel Programming 2 June 25th 07 12:43 PM
Excel 12 New Release Bart Vwb Excel Discussion (Misc queries) 5 October 4th 05 10:07 PM
IDTExtensibility2 kt Excel Programming 0 June 2nd 05 05:28 AM
IDTExtensibility2.OnConnection Event Mircea Pleteriu[_2_] Excel Programming 2 March 18th 05 02:36 AM
How to release the EXCEL.EXE procedure? Serge[_2_] Excel Programming 0 September 23rd 03 05:12 PM


All times are GMT +1. The time now is 09:28 AM.

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

About Us

"It's about Microsoft Excel"