This has happened to me twice now.
All of a sudden while making changes to and testing my project, the ribbon has stopped loading and I get the error message described in the title of this post. I’ve read the other posts with a similar problem and those solutions have not worked for me.
The first time it happened, after trying all of the suggestions I found, I ended up stripping down the code to it’s bare bones leaving only the test code I started out with. When I did that, it still didn’t work. Then, I tried copying the exact code to a new/different project and then it worked fine. So.... It seems that somewhere along the way Excel has decided not to allow the ribbon that is under the name of my old project name for some reason. Therefore, what I did was ended up rebuilding my whole project under a different name. I figured there must have been something in my code causing the problem and rather than look for it, I went the lazy route and just started over (I had just started so it wasn’t too big of a deal).
However… now it’s doing it again under my new project name! So something is up and I'm concerned about being able to use ExclDNA as a long term solution since there appears to be a miss somewhere.
Things I tried/notes:
My code:
MyAddin.dna:
<DnaLibrary Language="VB" Name="My Add-in" RuntimeVersion="v4.0">
<ExternalLibrary Path="MyAddin.dll" />
<CustomUI>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="MyAddinTabId" label="MyAddin" tag="My Add-in" insertAfterMso="TabAddIns">
<group id="MyAddinGroupId" label="TestArea">
<button id="CreateTableOfContents" tag="CreateTableOfContents" onAction="RunTagMacro" label="&Table of Contents" screentip="Insert TOC worksheet" size="normal" imageMso="TableOfFiguresInsert" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
</CustomUI>
</DnaLibrary>
Imports Microsoft.Office.Interop
Imports ExcelDna.Integration
Imports ExcelDna.Integration.CustomUI
Imports System.Runtime.InteropServices
<ComVisible(True)> _
Public Class Ribbon
Inherits CustomUI.ExcelRibbon
End Class
Public Module MyAddin
Sub CreateTableOfContents()
MsgBox("CreateTableOfContents")
End Sub
Public Function MyFunction() As String
MyFunction = "This is working."
End Function
End Module