+ Reply to Thread
Results 1 to 3 of 3

how to disable buttons on a custom ribbon

  1. #1
    Registered User
    Join Date
    03-22-2020
    Location
    Colombia
    MS-Off Ver
    Office 365
    Posts
    18

    Exclamation how to disable buttons on a custom ribbon

    Hi Guys,

    I made a custom ribbon with "custom UI editor", and the ribbon has almost 30 buttons in 3 groups.

    I want to disabled some of them if the user want it. In a excel sheet I have the button list and in the next column the user choose if he want enabled or disabled them one by one.
    This process should be doing when the excel file is open, so, if the user want enabled a disabled button he can do it but he can see the changes only when he close and open the file again.

    on xml for each button I put "getEnabled="ButtonGetEnabled" (the same for all) and "tag="button1" (different name on tag, deppending of the button name)

    but I don't know if it is ok and how write the sentences on vba to work it.

    I think is so hard or do I tangled to much with it?

    thanks for your help

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

    Re: how to disable buttons on a custom ribbon

    You need to invalidate the ribbon object in order to get the buttons to update.
    In this small example there is a button on the worksheet which will refresh the button state using the Invalidate method

    ribbon x m l creates a new tab, group and 3 buttons
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-22-2020
    Location
    Colombia
    MS-Off Ver
    Office 365
    Posts
    18

    Re: how to disable buttons on a custom ribbon

    Thanks a lot man, I was stuck with it for a long time!

+ 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. custom ribbon buttons by VBA
    By muss1210 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2018, 09:27 AM
  2. How does it work [custom Ribbon buttons specific to my file]
    By tellmewhy? in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-25-2017, 01:56 PM
  3. Put VBA ribbon together with Custom UI Editor Ribbon
    By czarlando in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2016, 05:46 AM
  4. [SOLVED] An alternative to the Add-Ins ribbon tab - Global Custom Ribbon Tab by Ken Puls
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2014, 10:01 PM
  5. Custom ribbon buttons don't export correctly
    By davejoseph98 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2013, 11:13 AM
  6. [SOLVED] Disable buttons in custom ribbon before opening a vbModeless UserForm
    By heapifyman in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 01-14-2013, 12:38 PM
  7. Mix up of buttons in Excel Add-In ribbon - how to delete buttons?
    By lausianne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2013, 08:51 AM

Tags for this Thread

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