Strange behavior

105 views
Skip to first unread message

Marco Born

unread,
Dec 16, 2016, 4:37:52 AM12/16/16
to Excel-DNA
Hello Forum,
I use ExcelDNA for a long time now. Since a few week I have the strange behavior that the XLL I generated is not working properly.It also has a Ribbon included.

- On my machine and also some other PCs all is working fine.
- On some PCs the users get this message when they start it: "The Ribbon/COM Add-in helper required by add-in Makros_DOK could not be registered. This is an unexpected error." The ribbon is not loaded.
- On some other PCs the Ribbon is loaded properly but if the users click the button nothing happens.

Does someone has the same problems and knows how to solve them? Could it be a problem resulting in the migration from Windows 7 to Windows 10?


Thanks a lot in advance,
Marco Born

Sergey Zhilyakov

unread,
Dec 16, 2016, 5:48:36 AM12/16/16
to exce...@googlegroups.com
Hi,

I observed the same behavior in the past. The problem was that the certificate, that we use to sign the add-in, has expired.

You could try to enable the checkbox 'Excel Options - Trust Center - Trust Center Settings - Add-ins - Require Applications Add-ins to be signed by Trusted Publisher' (if disabled) on your machine and try your add-in. If the add-in fails with the error that you mentioned above, the solution would be to disable this checkbox on client PCs.

You could also advise the clients to install the latest Windows Updates. This also helped me in the past.

Best regards,
Sergey

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+unsubscribe@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.

Govert van Drimmelen

unread,
Dec 16, 2016, 5:58:00 AM12/16/16
to exce...@googlegroups.com
Hi Marco,

There are many relevant discussions on the groups regarding this problem:

There seem to be a variety of causes.

Please let us know if you find anything that fixes it for you.

-Govert


From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of Marco Born [emb...@gmx.de]
Sent: 16 December 2016 11:37 AM
To: Excel-DNA
Subject: [ExcelDna] Strange behavior

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.

Govert van Drimmelen

unread,
Dec 16, 2016, 6:09:20 AM12/16/16
to exce...@googlegroups.com
First thing is to check the under Disabled Items (under File->Options->Add-Ins, Manage: Disabled Items).

Unhandled exceptions from your ribbon handlers will causes Excel to disable the ribbon add-in.

Seeing the ribbon but not having your callbacks called is very strange. Maybe you have a copy of ExcelDna.Integration.dll in your output directory (you should not - the right one is built into the .xll file).

Many other problems might cause the ribbon loading to fail, including security setting (and the certificate issue Sergey mentions), anti-virus or other security software on the computer, unusual registry permission restrictions (the user can't write to some parts of his user key).

-Govert



From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of Govert van Drimmelen [gov...@icon.co.za]
Sent: 16 December 2016 12:57 PM
To: exce...@googlegroups.com
Subject: RE: [ExcelDna] Strange behavior

Marco Born

unread,
Jan 1, 2017, 1:09:30 PM1/1/17
to Excel-DNA
Hello again,
I was not in the office the last weeks but will check out your suggestions tomorrow.

Thanks to all,
Marco Born

Marco Born

unread,
May 8, 2017, 9:26:52 AM5/8/17
to Excel-DNA
Hello again,
I was observing the problem during the last weeks. On some PCs the Addin was disabled and after I enabled it again it was working properly. But I still have the following problem:
I generate a new version of my XLL which runs without any problems on my PC and also on some other machines. On some other PCs the Ribbon is loaded but without any functionality (like written before). On others even the Ribbon is not loaded when Excel loads the XLL. On some more machines it is loaded and also the buttons can be clicked but then other error messages appear or the codes crashes while it works on my PC smoothly without any problems.

I use SharpDevelop to create my XLL and I use NetOffice. The target Framework is .NET 4.5 as anything newer is not supported by SharpDevelop yet. Could it be that this is the source of this problems? Maybe using the XLL together with 4.5 is working, but on a PC with 4.6 only it has this strange behaviour.

What do you think?

Have a nice day,
Marco

Govert van Drimmelen

unread,
May 8, 2017, 10:10:05 AM5/8/17
to exce...@googlegroups.com

Hi Marco,

 

I don’t think SharpDevelop, the .NET version or NetOffice are likely to be affecting this.

 

You might want to enable the Excel feature to display UI errors:

   File -> Options -> Advanced -> Show add-in user interface errors

 

This will let Excel pop up a proper message if there is any issue with the xml.

 

Next you can check whether the Excel versions differ between cases that work OK and cases that don’t. For example, the ribbon xml markup might have the Excel 2010+ version in the namespace, and then won’t load under Excel 2007.

 

Finally, it’s a good idea to wrap the ribbon callback methods in exception handlers, and do some basic logging if you have exceptions there. Excel seems to not like it when the ribbon callbacks leak unhandled exceptions.

 

-Govert

--

Marco Born

unread,
May 17, 2017, 10:34:33 AM5/17/17
to Excel-DNA
Hello Govert,
I already enabled the UI error display in Excel. On my machine I don't get any message; on others I get error messages right on the OnAction method of the ribbon button. All machines have Office 2010 and Win10. I also made sure that we have the same Option settings in Excel. It can be that the patchlevel of Windows is different. Could this be the source of the problems?
I have a Try-Catch on all functions and methods in my code. I'm not sure if there is needed something special for the logging of the XML stuff. Is a Try-Catch on the OnAction enough to get an error message or do I need to add something within the XML, too?


Have a nice day,
Marco


Govert van Drimmelen

unread,
May 19, 2017, 5:03:26 AM5/19/17
to Excel-DNA
Hi Marco,

It sounds like there might be more than one problem that you're seeing on the different PCs. 
One strange case that you're reporting is that the ribbon loads and displays, but your code does not run when you press the buttons, and there are no Excel errors displayed even though you've enabled the Excel options to "Show add-in user interface errors".

Maybe you can make a very simple new add-in with a ribbon, and test that on the same machine.
If that works fine, we need to figure out what might be different between your add-in and the working one. 
If it still doesn't work, we have a simpler case to debug.

If the right ribbon markup is loaded for your add-in then the matching helper COM add-in is also loaded, so most of the problems are dealt with.
I guess if you are targeting a new .NET framework (say 4.6) and using base class library methods only available there, and the end-user has only .NET 4.5, then there is a danger of your method failing at runtime (it will fail when .NET tries to JIT-compile it at runtime). Since your code did not actually run, your Try-Catch would not have been able to catch the error. You might even have a similar case if you have a dependency in that code that couldn't be loaded.

I haven't tested it, but in this case I would expect Excel to display an error message (if you have the "Show add-in user interface errors" setting enabled on that machine).

-Govert
Reply all
Reply to author
Forward
0 new messages