+ Reply to Thread
Results 1 to 3 of 3

Enable, Disable custom Ribbon Button based on Excel file name

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Enable, Disable custom Ribbon Button based on Excel file name

    How do I Enable and Disable a custom Ribbon button based on the Excel file that is open?
    I created a custom Button, with Groups.
    The goal is I have 7 groups.
    The main Ribbon button should be disabled if none of a list of Excel file names is not open.
    If a specific file name is open, I want to enable only that group that the macro is intended for.
    See attached image.
    Attached Images Attached Images
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Enable, Disable custom Ribbon Button based on Excel file name

    I would add code to all of the macros being called that checks the activeworkbook for a specific name or sheet name or custom property. If the workbook doesn't match your criteria, then give a message like "this macro isn't meant for your current workbook" and exit the sub. Otherwise, you can use Ribbon X coding to add a ribbon group to each workbook, which is only shown when the workbook is active.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Enable, Disable custom Ribbon Button based on Excel file name

    Those should work, thank you.

+ 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. Disable/enable spin button, hide and unhide button based on a cell value
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2022, 09:11 AM
  2. [SOLVED] Disable/Enable Button based on Cell Value
    By mlo_omg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2021, 11:51 AM
  3. [SOLVED] Is it possible to Enable/Disable particular Button under Home Ribbon by using vba?
    By kofung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2020, 10:05 PM
  4. Ribbon menu button disable enable.
    By glda19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2019, 01:59 PM
  5. [SOLVED] Disable a command button yet enable it based on other conditions
    By chin67326 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 12-23-2015, 08:37 AM
  6. Radio button enable/disable based on data in table
    By oscarmiike in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2015, 01:37 AM
  7. [SOLVED] Enable Disable spin button based on a textbox
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2015, 07:21 AM

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