locked
Creating a new and unique ribbon tab. RRS feed

  • Question

  • Hi Folks,

    I have an Excel addin developed in VS2010 that creates a new ribbon tab. On this new tab are a number of buttons that perform various functions. My problem is that the tab that I create when the addin is installed may clash with other existing tabs. One user reports that an existing tab is removed completely and my tab appears. I really need to be able to create a new tab that doesn't in any way clash with any other tabs that may be installed.

    Can anyone advise on this matter?

    Thanks

    Bernie


    Bernie

    Tuesday, September 10, 2013 12:25 AM

Answers

  • Hi Bernie

    OK, you aren't creating a new tab, you're re-purposing the built-in Add-ins tab. This tab is designed to allow customizations to share a single tab. All you're doing is re-naming the caption displayed, which certainly could give the impression that tabs are "disappearing".

    If you want to use the built-in tab then you should retain the defaults (label property) in order to avoid confusion. The GROUPS in the tab will be unique to your add-in(s).

    If you want your own tab, then you need to insert a new tab control into the Ribbon Designer. The caveat with this, however, is that your second add-in won't be able to share this as the Ribbon Designer doesn't include that functionality. That functionality is only available when using Ribbon XML instead of the Ribbon Designer.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Bernie Ok Friday, September 13, 2013 2:32 AM
    Thursday, September 12, 2013 8:08 AM

All replies

  • Hi Bernie

    Strange. I didn't think tabs and groups from different Ribbon containers would do this, unless your code is dynamically hiding tabs with specific ids. But...

    It might be possible to make sure your code works only with your elements if you include a Namespace in your Ribbon XML and use the idQ attribute to identify your tab, rather than the id attribute.

    Search idQ in this article
    http://msdn.microsoft.com/en-us/library/aa722523(v=office.12).aspx

    And see also
    http://msdn.microsoft.com/en-us/library/dd908788(v=office.12).aspx

    This is actually meant to allow different ribbon containers to share tabs and groups, but I suspect it might also have the effect of reducing/eliminating interference - you'll need to test it. I'll be interested in learning the result :-)

    Usually, a company URL is used as the basis for a namespace since these are unique domains on the Internet. But a namespace doesn't have to be a URL, it can be pretty much any string you want that meets the requirements given in the second article.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, September 10, 2013 9:46 AM
  • Thanks Cindy,

    OK, I don't really know anything about XML so I am a bit befuddled by your reply.

    Let me explain a bit more about what is happening. I have an Excel ribbon addin that when installed creates a new tab. Then I install another Excel addin and the buttons from this new addin appear on the same tab. What follows is a snapshot of my ribbontab properties.

    Just wondering if the default value for the ControlId property were changed would this create a new unique tab for me? And crucially, if I change the value of the ControlId property would this create any problems when existing users update their software?

    Best,

    Bernie


    Bernie

    Wednesday, September 11, 2013 11:19 PM
  • Hi Bernie

    OK, you aren't creating a new tab, you're re-purposing the built-in Add-ins tab. This tab is designed to allow customizations to share a single tab. All you're doing is re-naming the caption displayed, which certainly could give the impression that tabs are "disappearing".

    If you want to use the built-in tab then you should retain the defaults (label property) in order to avoid confusion. The GROUPS in the tab will be unique to your add-in(s).

    If you want your own tab, then you need to insert a new tab control into the Ribbon Designer. The caveat with this, however, is that your second add-in won't be able to share this as the Ribbon Designer doesn't include that functionality. That functionality is only available when using Ribbon XML instead of the Ribbon Designer.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Bernie Ok Friday, September 13, 2013 2:32 AM
    Thursday, September 12, 2013 8:08 AM
  • Thank you for all of your help Cindy,

    Very Best,

    Bernie


    Bernie

    Friday, September 13, 2013 2:32 AM