+ Reply to Thread
Results 1 to 5 of 5

Create Ribbon but for only a single excel workbook

  1. #1
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    405

    Create Ribbon but for only a single excel workbook

    Hi Guys,

    Is there a way to make a a new ribbon (like "Home" or "Insert"), but have custom ribbon only appear within a particular excel sheet.

    eg, have a custom ribbon per excel document/worksheet?

    if there is a way, how do i do this?

    thanks!
    Thanks,

    JimmyWilliams

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Create Ribbon but for only a single excel workbook

    You need to use the getVisible callback of the Tab.

    Set up the customui xml.

    VBA code to set a reference to the ribbon, so you can Invalidate it and get the callback to be called.
    You will also need a class object with events exposed to the Application. If you catch the SheetActivate event you can Invalidate the ribbon.

    In this example SHEET2 will display the new Tab 1 on the ribbon.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    405

    Re: Create Ribbon but for only a single excel workbook

    that is interesting what you have done.

    How do I insert a sub() into the ribbon as a button?

  4. #4
    Forum Contributor
    Join Date
    04-02-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    405

    Re: Create Ribbon but for only a single excel workbook

    And how do i make "Group1", "Group2" and rename them.
    and rename "button1"?

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Create Ribbon but for only a single excel workbook

    The construction of the ribbon is done use xml, stored within the customUI section of the zipped workbook file.

    You will find a bunch of information here.
    https://www.contextures.com/excelrib...customtab.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Transferring Excel Macro Workbook & Excel Ribbon to multiple users
    By General_Gin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2021, 09:16 AM
  2. How to see XML ribbon sample code for an excel workbook?
    By RustyNail in forum Excel General
    Replies: 0
    Last Post: 05-26-2015, 12:11 PM
  3. Create ribbon in excel 2007/2010
    By caanilsoni in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-01-2014, 07:12 AM
  4. How to create new workbook with custom ribbon in VBA
    By MichalJB in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2013, 02:52 PM
  5. [SOLVED] How to Create more than a basic Tab on Ribbon in Excel 2010
    By John_Day83 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2013, 04:07 AM
  6. Create multiple workbooks from a single workbook
    By drgreg819 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2012, 06:58 PM
  7. Ribbon - Multiple xlam adding into single Ribbon tab
    By gooopil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2011, 03:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1