Debugging Excel Addin- AV on exit

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

Debugging Excel Addin- AV on exit
 
George Spears




Posts: 70
Joined: 2010-05-06
Environment: Delphi XE6, Windows 8.1, Excel 2013, Add-In Express Version 7.8 Release (build 1223, which is the current release).

I am updating a plug-In for Excel using Add-In Express. This is version 2, which was a major rewrite, so many things changed. I am getting two odd behaviors. Everything compiled and runs….

Odd behavior one. On exiting Excel, I get 7 AVs. Specifically exception class $C0000005 with message access violation… read of address… This issue is that this happens even though I can’t find any of my code that is running. From Delphi, I ‘Run with Debugging’. This automatically starts Excel. I get the normal Excel splash screen telling me what plug-ins are being loaded. Mine is listed. The first Excel screen I see asks me what file to open. I immediately close Excel. I now get my AVs, - 7 right in a row.

Something I am running is AV’ing on exit. I have basically commented out everything I can think of.
My .dpr file does NOT have any code between ‘begin’ and end’.
My AddInModule only has one routine, AddInModuleStartupComplete, and the very first line is ‘Exit’
I have commented out all code in the ‘initization’ on every form except the AddInModule, which only had only line added by Add-in Express


TadxFactory.Create(ComServer, TPaylay, CLASS_Paylay, TAddInModule);


My whole app only has FINALIZATION code in 2 places, and both only contain lines similar to


 if Assigned(DM1) then
    DM1.Free;


This brings me to my 2nd issue.
I tried using Madshi MadExcept. When I use that, I get a Stack overflow when I start Excel. I have increased stack size from 1 MB to 12 MB, and I still get stack overflows.

This app only runs in Excel, and AddInModule.LoadBehavior = 3; My app does not have ANY Task panes, everything is done via menu (TadxRibbonTab).

I am at a loss what to try next to debug this. I have tried viewing the AV address, and I just get assembly code. What do I do next to try to isolate where I am getting my errors?

Thanks
George S
Posted 30 Sep, 2015 06:56:32 Top
George Spears




Posts: 70
Joined: 2010-05-06
One additional comment, it I put break points on BOTH my FINALIZATION CODE, the order is...:
Start App
Excel Loads
I do not choose ANY spreadsheet files, but instead close Excel
AV occurs here
FINALIZATION CODE now runs.

Thanks
Posted 30 Sep, 2015 07:11:09 Top
Andrei Smolin


Add-in Express team


Posts: 14137
Joined: 2006-05-11
Hello George,

Could you please send us a project reproducing the issue? If positive, send it to the support email address; you can find it in {Add-in Express installation folder}\readme.txt. Please make sure your email contains a link to this topic.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Sep, 2015 08:39:44 Top
George Spears




Posts: 70
Joined: 2010-05-06
Andrei,

I have started the process of stripping out my code, but it is a somewhat painful process. In the midst of this, I began to wonder if there is a conflict with other plug-ins, and I found that is the case. I am a registered user of Ablebits (Ultimate Suite for Excel, version 2015.1.0.380) , which I understand that Add-in Express develops. My code works fine without Ablebits enabled. With Ablebits enabled, when I click the Excel Close button, I get 7 AVs (but only when running from within Delphi IDE, no error messages when running Excel normally). If I am stepping through my code, the AVs BEFORE any Finalization routines in my code is executed.
Posted 01 Oct, 2015 07:56:07 Top
Andrei Smolin


Add-in Express team


Posts: 14137
Joined: 2006-05-11
George,

This means we may be able to find the cause of this. Please provide a project to let us replicate the issue.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 01 Oct, 2015 08:24:32 Top