"The Ribbon/COM add-in helper required by add-in MyAddin could not be registered. This is an unexpected error."

249 views
Skip to first unread message

Andrei F

unread,
Dec 1, 2016, 11:32:47 PM12/1/16
to Excel-DNA
I wonder if there are any recommended troubleshooting steps when the Ribbon/COM addin fails to register or start?

Sergey Zhilyakov

unread,
Dec 2, 2016, 1:07:44 AM12/2/16
to exce...@googlegroups.com
Hi,

I wonder if there are any recommended troubleshooting steps when the Ribbon/COM addin fails to register or start?

you could try the following:
  • Make sure your ribbon class is marked as public with [ComVisible] attribute.
  • Open Excel - Options - Add-ins - Disabled items - Enable your add-in if it is there.
  • Open Excel - Trust Center - Trust Center Settings - Add-ins - Disable 'Require Applications Add-ins to be signed by Trusted Publisher'.
  • Install the latest Windows Updates.

Best regards,
Sergey

On Fri, Dec 2, 2016 at 8:32 AM, Andrei F <fandre...@gmail.com> wrote:
I wonder if there are any recommended troubleshooting steps when the Ribbon/COM addin fails to register or start?

--
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 2, 2016, 1:15:33 AM12/2/16
to exce...@googlegroups.com
Also, if there are any errors in the xml, Excel won't load it.
Enable the Excel option to "Show add-in user interface errors" to get error messages for incorrect xml.

-Govert
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.

Andrei F

unread,
Dec 2, 2016, 4:18:10 AM12/2/16
to Excel-DNA
Thanks guys.


On Friday, December 2, 2016 at 1:07:44 PM UTC+7, Sergey Zhilyakov wrote:
Hi,

I wonder if there are any recommended troubleshooting steps when the Ribbon/COM addin fails to register or start?

you could try the following:
  • Make sure your ribbon class is marked as public with [ComVisible] attribute.
  • Open Excel - Options - Add-ins - Disabled items - Enable your add-in if it is there.
  • Open Excel - Trust Center - Trust Center Settings - Add-ins - Disable 'Require Applications Add-ins to be signed by Trusted Publisher'.
  • Install the latest Windows Updates.

Best regards,
Sergey

On Fri, Dec 2, 2016 at 8:32 AM, Andrei F <fandre...@gmail.com> wrote:
I wonder if there are any recommended troubleshooting steps when the Ribbon/COM addin fails to register or start?

--
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 2, 2016, 4:31:45 AM12/2/16
to exce...@googlegroups.com
What fixed your problem?

-Govert

Serge

unread,
Dec 2, 2016, 11:51:37 AM12/2/16
to Excel-DNA
Hey Govert, I'm working with Andrei on this issue.  None of the steps above helped.  User still has the problem.  User's .NET is 4.5.2 if that has any bearing.

Serge

unread,
Dec 2, 2016, 11:56:27 AM12/2/16
to Excel-DNA
User just reported it's working.  User said this was after Symantec virus definition update.  That's the only thing that changed.  Any insight into how that is related to anything?  Thanks!

Govert van Drimmelen

unread,
Dec 2, 2016, 12:00:06 PM12/2/16
to exce...@googlegroups.com
No - you should ask Symantec.

Maybe they interfere with the user registry permissions, or watch and block programs writing to the registry, or something like that.

-Govert


From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of Serge [theser...@gmail.com]
Sent: 02 December 2016 06:56 PM
To: Excel-DNA
Subject: Re: [ExcelDna] "The Ribbon/COM add-in helper required by add-in MyAddin could not be registered. This is an unexpected error."

Serge

unread,
Dec 16, 2016, 10:44:27 AM12/16/16
to Excel-DNA
Since I last wrote I've seen this occur on 4 other machines.  Some notes:

* restart is always necessary to solve it
* everyone has had Symantec Endpoint Protection running but I can't prove conclusively if this is a Symantec Endpoint Protection issue or not
* some users have had to go into Options... Addins... Manage... Com Addins... and manually enable it there after restarting

My next step is to try to install Symantec Endpoint Protection endpoint protection on a VM and experiment with settings.

Serge
To post to this group, send email to exc...@googlegroups.com.

Govert van Drimmelen

unread,
Dec 18, 2016, 4:32:25 AM12/18/16
to exce...@googlegroups.com
Hi Serge,

One option for debugging this on a problem machine (before you reboot) is to use the Process Monitor to check whether any registry calls are failing unexpectedly (Excel-DNA tries to write to the registry, first the machine hive and if that fails the user's hive, to register the COM add-in).

If you see unexpected failures you can try to make similar registry edits yourself, and if these work differently before and after the reboot, that might be a clue.

You can also investigate some of the Symantect settings, or indeed involve them in this (I presume you are paying for their software, after all).

-Govert



Sent: 16 December 2016 05:44 PM

Serge

unread,
Dec 21, 2016, 10:15:36 AM12/21/16
to Excel-DNA
Govert, Process Monitor says: 

09:51.1    20128    RegOpenKey    HKLM\Software\Wow6432Node\Microsoft\Office\Excel\Addins    ACCESS DENIED    Desired Access: Read/Write

But later I see this:

10:09.1    EXCEL.EXE   20128   RegOpenKey HKCU\Software\Microsoft\Office\Excel\Addins SUCCESS Desired Access: Read / Write

So it seems access worked for the user hive?  Not quite sure what I'm looking for though here.  On this user's computer it doesn't work after disabling Symantec and/or rebooting.  My next step is to work with the desktop admin to disable restrictive settings one by one.

Serge

Govert van Drimmelen

unread,
Dec 21, 2016, 2:00:26 PM12/21/16
to exce...@googlegroups.com
Hi Serge,

Have you checked the basics, like Disabled Items?

You said initially that you had 4 computers with problems. Have any of them been resolved? How?

It's fine if HKLM is not writeable.
In the past I've seen security settings that block creating a new key under HKCU\Software\Classes\CLSID\. That's certainly unexpected.

-Govert



Sent: 21 December 2016 05:15 PM

Serge

unread,
Dec 21, 2016, 7:20:05 PM12/21/16
to Excel-DNA
Thanks, Govert.  The four all worked upon restart and some required fiddling post-restart with the Com Add-Ins list.  Yes, the basics like Disabled Items have been thoroughly checked.  

This 5th computer with issues doesn't work even upon restart.  In looking at the Process Monitor logs, I see everything with HKCU\Software\Classes\CLSID got a result of NAME NOT FOUND.  Not sure what that means as far as access goes. 

I'll hopefully play with permissions with the admin tomorrow and revert back.

Govert van Drimmelen

unread,
Dec 22, 2016, 1:10:25 AM12/22/16
to Excel-DNA
So the weird sequence where we can write to the registry and then not read back is described in these discussions:


There was a check-in in March that makes a small change to the way the registry is written - maybe that has already fixed it.

Would you be able to make a test using Excel-DNA version 0.34 beta, without 'fixing' the machine otherwise?

-Govert

Serge

unread,
Dec 22, 2016, 5:18:01 AM12/22/16
to Excel-DNA
Tried this.  Same result.  Open to any other ideas!

Thanks,
Serge

Govert van Drimmelen

unread,
Dec 22, 2016, 5:36:34 AM12/22/16
to exce...@googlegroups.com
Are you saying you have the same problem with the v0.34 beta?

Can you confirm the the key is created successfully, but then fails when read back, as in those traces?

Is this a 32-bit Excel on 64-bit Windows, so that the WoW64 registry redirection is a possible issue?

Any other security or management software installed?

-Govert

Serge

unread,
Dec 22, 2016, 7:30:44 AM12/22/16
to Excel-DNA
Govert,

I did not do a trace this time.  This is indeed 32-bit Excel on 64-bit Windows.  Not sure about other security or management software.  I'll try again with more diagnostic info later today.  Would this help https://github.com/Excel-DNA/ExcelDna/wiki/Diagnostic-Logging ?

Serge
Message has been deleted

Serge

unread,
Dec 22, 2016, 9:06:45 AM12/22/16
to Excel-DNA
Reposting with more info: Just tried again.  Interestingly, in the meantime the user upgraded from win7/excel2010 to win10/excel2016.  64-bit machine 32-bit excel.  Exact same issue.  ExcelDna.Integration version is 0.34.6161.41353.  Here is the log from ExcelDnaIntegration:

ExcelDna.Integration Verbose: 4 : Getting Application object
ExcelDna.Integration Verbose: 4 : Got Application object: System.__ComObject
ExcelDna.Integration Error: 4 : The Ribbon/COM add-in helper required by add-in could not be registered.

This is an unexpected error.
ExcelDna.Integration Information: 4 : LoadComAddIn exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   --- End of inner exception stack trace ---
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at ExcelDna.Integration.ExcelComAddInHelper.LoadComAddIn(ExcelComAddIn addIn) with /K in CommandLine
ExcelDna.Integration Verbose: 1 : Exit Integration.DnaLibraryAutoOpen

HKCU\Software\Classes\CLSID\* all read NAME NOT FOUND

Not sure what else to look for in the Process Monitor log?

Thanks!
Serge

Govert van Drimmelen

unread,
Dec 22, 2016, 12:35:35 PM12/22/16
to exce...@googlegroups.com
It might help if you can use ProcessMonitor to see where exactly the key is created, before it is read by Excel.

See the highlighted parts of the first message here: https://groups.google.com/forum/#!topic/exceldna/CF_aNXTmV2Y/discussion

Further investigation would probably be to extract the behaviour out of Excel-DNA (and out of Excel if possible) by writing independent code that does the same write and read, and from there understand when the registry redirection interferes with what we are doing.

This is, however, not a common problem (as far as I can tell).

-Govert



Sent: 22 December 2016 04:06 PM

Serge

unread,
Dec 22, 2016, 7:28:49 PM12/22/16
to Excel-DNA
Govert, if I understood correctly from that thread how ExcelDna registers com ribbons, then I'm even more confused now because all Dna.*\clsid calls look quite successful.  See https://gist.github.com/saluker/40b67c43f331f6d0a026358b063ad75a

I'll try to run the trace on a machine where CLSID loads successfully and compare results, but I can't imagine it being more successful than what I'm seeing here.

Does the stack trace I put two posts above clearly indicate that this is a registry redirection issue?  Maybe something else is going on?

Serge
Message has been deleted

Andrei F

unread,
Jan 9, 2017, 10:33:08 PM1/9/17
to Excel-DNA
Hello Govert,

I was able to partially mitigate this problem by using a modified ExcelDna.Integration and moving COM addin unregistration to the moment of unload instead of doing unreg immediately. https://github.com/Excel-DNA/ExcelDna/blob/master/Source/ExcelDna.Integration/ExcelComAddIn.cs#L137

After this experiment it still shows the "unspecified COM error" when loading, but the ribbon works well.

Do you think we can integrate this into the main stream?

Andrei

Govert van Drimmelen

unread,
Jan 10, 2017, 1:03:22 AM1/10/17
to exce...@googlegroups.com
Hi Andrei,

I think multiple issues are being confused in this thread.

Under some circumstances (on some computers) the ribbon helper COM add-in fails to load.
This is not clearly related to the registration.

Is there a reproducible issue with the current implementation of the COM registration?
I don't know of one, so I suggest you start a new thread if you have such a case and would like to discuss it.

-Govert



From: exce...@googlegroups.com [exce...@googlegroups.com] on behalf of Andrei F [fandre...@gmail.com]
Sent: 10 January 2017 05:33 AM

Andrei F

unread,
Jan 10, 2017, 11:07:56 PM1/10/17
to Excel-DNA
Hello Govert,


> Under some circumstances (on some computers) the ribbon helper COM add-in fails to load.

This is the problem that I was trying to solve. When I moved COM addin unregistration to a later point, the COM addin and Ribbon started loading correctly on a PC where they didn't (despite the "unspecified COM error" is still popping up when loading).

> Is there a reproducible issue with the current implementation of the COM registration?

I'm afraid that we don't know how to reproduce this problem on another PCs.

Andrei

Andrei F

unread,
Jan 12, 2017, 5:30:44 AM1/12/17
to Excel-DNA
PS should I push my experimental version to the main repo for you to take a look?

Govert van Drimmelen

unread,
Jan 12, 2017, 5:40:03 AM1/12/17
to exce...@googlegroups.com

Hi Andrei,

 

I’m still very confused about this topic.

 

You can certainly make a pull request on GitHub so that I can have a look, and that would be a better place for discussion.

But it’s not a change I’m likely to accept without understanding why it fixes the problem – at least having some understanding of why leaving the registration after the COM add-in is loaded makes a difference.

 

I really would rather be in a position where the problem and the fix you propose are reproducible.

 

-Govert

Andrei F

unread,
Jan 13, 2017, 1:23:03 AM1/13/17
to Excel-DNA
>
You can certainly make a pull request on GitHub so that I can have a look, and that would be a better place for discussion.

Ok. What about access rights?

Hi Andrei,

 

-Govert

 

 

    <li class="MsoNormal" style="color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-l

Govert van Drimmelen

unread,
Jan 13, 2017, 1:33:33 AM1/13/17
to exce...@googlegroups.com
You don't need anything for a pull request.

-Govert


Sent: 13 January 2017 08:23 AM
--

Andrei F

unread,
Jan 13, 2017, 5:20:37 AM1/13/17
to Excel-DNA
I need to push a new branch to create a pull request; it says this:

Pushing to g...@github.com:Excel-DNA/ExcelDna.git
ERROR: Permission to Excel-DNA/ExcelDna.git denied
To post to this group, send email to exc...@googlegroups.com.

Govert van Drimmelen

unread,
Jan 13, 2017, 9:59:48 AM1/13/17
to exce...@googlegroups.com
I'm not so smooth with the GitHub process myself.
But I think you need to make a fork of the repo, then push to a branch on your fork.

-Govert


Sent: 13 January 2017 12:20 PM
To post to this group, send email to exce...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages