[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

.Net AddIn - Password prompt when closing Excel

Sergei Didur

11/23/2007 2:03:00 PM

I am developing COM addIn for excel 2003 using C# and .Net 2.0 interop.
In the code I am sibscribing to excel events like open, activate, etc.
It looks like it causing problem with any VBA addin installed that uses same
events.

For example if you have "Lookup Wizard" addin from Microsoft - after you
click Tools\Lookup so wizard form is shown, when Excel is closed you would
get password prompt. If you don't open any VBA addin form - then not prompt
will appear.

All objects in my addin are disposed and cleared (including events), host
app domain is closed, but password prompt still appears.

Any idea what could be the problem ?

1 Answer

Sergei

11/23/2007 10:41:00 PM

0

It looks like there is a bug in
Microsoft.Office.Interop.Excel.AppEvents_Event class implementation - it does
not close events sink properly.

So, solution is to implement disposable event sink class based on AppEvents
interface by yourself and connect to Excel events sink using
IConnectionPoint.Advise method.

In Dispose method you would need to disconnect using
IConnectionPoint.Unadvise() method.

"Sergei Didur" wrote:

> I am developing COM addIn for excel 2003 using C# and .Net 2.0 interop.
> In the code I am sibscribing to excel events like open, activate, etc.
> It looks like it causing problem with any VBA addin installed that uses same
> events.
>
> For example if you have "Lookup Wizard" addin from Microsoft - after you
> click Tools\Lookup so wizard form is shown, when Excel is closed you would
> get password prompt. If you don't open any VBA addin form - then not prompt
> will appear.
>
> All objects in my addin are disposed and cleared (including events), host
> app domain is closed, but password prompt still appears.
>
> Any idea what could be the problem ?
>