none
How to prevent other toolbars from being added to custom Excel VSTO ribbon? RRS feed

  • Question

  • I am writing a custom C# Application-level add-in for Excel 2010 that adds a new ribbon tab to the GUI.  However, I also use Excel for other purposes, with various COM add-ins (i.e. the SAP Business Explorer Analyzer).  These COM add-ins add extra toolbars to Excel.  My problem is that these COM add-ins insert their toolbars into my custom VSTO tab.  Ideally these various toolbars should be inserted into a generic "Add-ins" tab, or any other tab but mine.  How can I prevent this extra 'junk' from being inserted into my single-purpose VSTO tab?
    Thursday, September 26, 2013 3:33 PM

Answers

  • Hi,

    If you add a ribbon by designer mode, the ribbon will insert into tab named “ADD-INS” by default. So if there are many add-ins have been installed and activated, they will be inserted into tab named “ADD-INS” and have different group.

    We can change ribbon type to a custom add-in and have specified tab name.

    Here are the code I changed in ribbon.designer.cs:

    //this.tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
                this.tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Custom;
                this.tab1.Groups.Add(this.group1);
                this.tab1.Label = "MyOwnAdd-in";
                this.tab1.Name = "MyOwnAdd-in";

    The effect



    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Sunday, September 29, 2013 3:56 PM
    Moderator