Excel-DNA / ExcelDna

Excel-DNA - Free and easy .NET for Excel. This repository contains the core Excel-DNA library.
https://excel-dna.net
zlib License
1.26k stars 272 forks source link

Conflict between two addins uses Excel-Dna #625

Open orikoren12 opened 11 months ago

orikoren12 commented 11 months ago

Hi

We are facing an issue with a customer who uses our addin along with another addin which is also using Excel-Dna. Both addin are using custom functions. The Excel is basically crashing and fails to launch when both addins are set.

Is this a known issue? Is there anything we can check from our end? Any other information we can provide here?

govert commented 11 months ago

It's not a general problem that multiple add-ins can't work together (you can test this yourself). So it's something related to what your add-in or the other one is doing, probably during startup (AutoOpen or Ribbon loading)

Does it happen even if you make a very simple add-in (just a single function)? What version of Excel-DNA and .NET are you using? Does it happen with different Excel-DNA versions? Are you able to contact the other developers, and maybe give them a copy of your add-in?

govert commented 11 months ago

Your add-ins certainly should not have the same name, to be sure.

orikoren12 commented 11 months ago

Does it happen even if you make a very simple add-in (just a single function)? Ori > we can try this. What version of Excel-DNA and .NET are you using? Ori > we are using .NET framework 4.8, DNA version 1.6.0 Does it happen with different Excel-DNA versions? Ori > we didn't try, do you think we should? Are you able to contact the other developers, and maybe give them a copy of your add-in? Ori > we'll try to contact them

Thanks for the quick response !

govert commented 11 months ago

You can check the Windows Event Log to find a code for the crash, and maybe some more information if it comes from an unhandled .NET exception.

orikoren12 commented 11 months ago

Hi @govert Thanks for you advices !

We have some progress We got this window in debug mode:

image

After modifying the name of the of the class which implements the ExcelRibbon class we didn't have this window any more. This seems like COM registration of two classes with same name (?)

The thing is that we still get Excel crash when running it with real installation (after the change above) And while debugging it, we are getting this dialog when closing the Excel:

image

Is this something that was seen in the past? Again all the issues are related to having two DNA addin simultaneously

govert commented 11 months ago

If there is an Excel crash while your add-in is being called, then Excel will show the "running into problems" message. If you then disable the add-in (which might not disable the whole add-in, but just the ribbon part), you might get the first message, saying that the ribbon was not loaded, possibly because it has been disabled. You can go to File -> Options -> Add-Ins: Manage: Disabled add-ins to re-enable the add-in.

Why would the add-in crash Excel? Some delicate places would be any shutdown or update handler in the ribbon which might be called during shutdown. Also, workbook events the run when a workbook is closed can cause trouble since they might be handled by all the add-ins involved.

My advice is to figure out whether a trivial or very simple add-in (without ribbon or with very simple ribbon) still results in the same problems. If so, then you need the help of the other add-in vendor to resolve this. If not, you can figure out what part(s) of your add-in are needed to cause trouble.

orikoren12 commented 11 months ago

@govert Thanks for you feedback and your advice, I've tried very simple addin and the issue is still there. I'm contacting the other addin vendor to see if they will be able to somehow assist here.