XLLModule OnClose Event is triggered before excel closes

Add-in Express™ Support Service
That's what is more important than anything else

XLLModule OnClose Event is triggered before excel closes
 
Miguel Sousa




Posts: 7
Joined: 2010-11-22
Hi,

When we make changes to any open workbook, then we command to close excel, a message box pops up and asks if we want to save changes, don't save, or cancel.
At this moment the OnClose event has already been triggered in the ADXXLLModule.
If i choose cancel, and i do an operation that requires the ADXXLLModule (which is now closed), the XLLModule_OnInitialize is called.
In the XLLModule_OnInitialize event, i have a call to HostApplication, and just by calling that property i get the following exception:

«COM object that has been separated from its underlying RCW cannot be used.»

My question is, shouldn't the ADXXLLModule be closed only after the excel popup message, and only if cancel is not chosen?

And do you have any ideas how can i workaround this? Because if anyone closes excel then choses cancel, they won't be able to use the ADXXLLModule operations until they restart excel.

Thank you.
Posted 28 Mar, 2011 10:06:23 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Miguel,

It looks like this is a bug. I have reproduced it on my PC with Excel 2010 and filed it in our bug-tracking system under #2754. Our guys will research that issue and let you know the results.

Thank you for pointing this to me.
.NET, Extended MAPI, Windows Phone & RT
Posted 28 Mar, 2011 11:45:20 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Miguel,

We have prepared an intermediate build of the loader with a hotfix for you. Please check out your Inbox and then replace the loader in the Redistributables subfolder of the Add-in Express installation folder with a new one. Also please don't forget to replace the adxloader in the Loader folder of your project with a fixed one.

Please let me know whether it works for you in any case.
.NET, Extended MAPI, Windows Phone & RT
Posted 30 Mar, 2011 12:51:41 Top
Miguel Sousa




Posts: 7
Joined: 2010-11-22
Hi Eugene, thanks for the quick reply. I had a problem with the email filter system, that deleted your email because adxloader was a potential trojan horse :D
Could you send the attachment in a different format?

Thanks again
Posted 05 Apr, 2011 10:13:17 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Miguel,

I have just re-send it to you. Please check out your Inbox and let me know the results.
.NET, Extended MAPI, Windows Phone & RT
Posted 05 Apr, 2011 10:45:32 Top