I have an excel add-in which uses third-party library for SOAP protocol to connect our services. The library is Pocket Soap. All worked fine in most of Excel versions(starting from 2003), but recently some clients which use Office 365 reported Excel displays Automation Error message and then crashes. Part of clients also use 365 version and it works fine for them.I did some investigation and found that error happens on attempt to call COM object of the pocketsoap library.The code is:
Dim env as New PocketSOAP.CoEnvelope12 env.setMethod "FooMethodName", "FooNamespaceURI" 'Here the error happens
Internally, in COM object, this code seems only setting provided strings as method name and namespace into variables.
I tried disable of add-in and place the pure code above in blank workbook as macros function and found following:
- Code works fine if workbook was just created
- If workbook is saved and reopened the code crashes excel
- If blank workbook is saved(without macros), then reopened and code placed in macro(Alt+F8) code works fine
- If workbook is saved with blank macros function, then reopened and code placed - excel crashes.
In other words, something happens when workbook with macro is saved and the code stops working.
I also tried my simple COM dll written with ATL and C++ that just sets a string into variable and it works fine in all cases.
I will do further investigation and would be very appreciate for any ideas from community where should I look further.