AccessViolationException in Excel Com addin for all versions > 2008 (2102, 2108,...)

Copper Contributor

Hi

 

I'm developping a Com/.Net addin using ExcelDNA.

An AccessViolationException occurs for all Excel versions greater than 2008 when calling the following code :

object xlApp = ExcelDnaUtil.GetApplicationNotProtectedNoThrow();
Type appType = xlApp.GetType();
object result = appType.InvokeMember("Run", BindingFlags.InvokeMethod, null, xlApp, new object[] { macroName, 0.0 }, _enUsCulture);

No other addin is loaded : excel is launched in "safe-mode" using "/s" parameter.

It seems that a workbook with a shape needs to be loaded.

 

After the exception, Excel becomes unusable (flashing UI, can not close it anymore)

 

Atm, we stick to Office 365 2008 version, but support will end soon (March 08 2022).

Any idea on how to solve the problem ?

0 Replies