Whenever I try to add a new ribbon into my Excel 2010 addin project, I get the following warning message
The designer could not be shown for this file because none of the
classes within it can be designed. The designer inspected the
following classes in the file:Ribbon2 — The base class ‘System.Object’ cannot be designed.
ThisRibbonCollection — The base class‘Microsoft.Office.Tools.Ribbon.RibbonCollectionBase’ cannot be
designed.
Also, if we view the code in Ribbon1.Designer.cs, the error is pointing to this line:
base.Dispose(disposing);
I have no idea what went wrong there. Am I missing any other Office assemblies here?
(in my project I have got Microsoft.Office.Core, Microsoft.Office.Interop.Excel, Microsoft.Office.Tools, Microsoft.Office.Tools.Common, Microsoft.Office.Tools.Excel, Microsoft.Office.Tools.Common.v4.0.Utilities, Microsoft.Office.Tools.v4.0.Framework)
Can anyone help? Thanks.
Hmm it seems that VS2010 somehow will be a bit quirky unless we follow a certain order of adding projects. Anyway, what I did was that I had to recreate a new blank solution, add Excel Addin project first, add Ribbons, and then add my class library project to complete the whole project import. And it is working fine now.
Still not sure why it throws errors if we add class library first. I guess perhaps it might have something to do with accessing assemblies.