+ Reply to Thread
Results 1 to 5 of 5

Activate button upon checkbox selection in custom ribbon

  1. #1
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2010 & 2007
    Posts
    210

    Question Activate button upon checkbox selection in custom ribbon

    Hi everyone,

    Please find the attached excel macro file, where I have two Samples for checkbox and their depending button's action
    In the Checkboxes Sample 2", I have two enabled checkboxes and a button which is disabled.

    Please help me to fix the program as below:
    1.) If both checkboxes are unchecked, then button should be disabled. If any checkbox is marked, then button should be enabled, so the user can click on it to run the codes.

    2.) Whenever user opens this macro workbook, then I want to make sure that both the checkboxes are unmarked and button is also disabled.

    3.) Whenever user opens this macro workbook, then I want to activate the "Checkboxes" tab in the ribbon.

    I am using Excel 2013 and 2010.


    Note - I have found something similar on another thread as below (for above point# 1), but I want to keep the button disabled until user not select any checkbox.
    http://www.excelforum.com/excel-prog...h-a-macro.html

    Thank you in advance!

    With Regards,
    SunOffice
    Attached Files Attached Files
    Last edited by SunOffice; 04-14-2015 at 08:35 PM. Reason: Solved by Andy Pope sir!
    Excelforum is Completely Awesome! True learning with Live Examples & Best Techniques!!

  2. #2
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2010 & 2007
    Posts
    210

    Re: Activate button upon checkbox selection in custom ribbon

    Any expert reviews on my post??

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

    Re: Activate button upon checkbox selection in custom ribbon

    First you need to use the onLoad event to set a reference to the ribbonUI so you can invalidate it.
    This will make the getEnabled event fire so the state of the button can be updated when the checkboxes are clicked.

    It will also allow you to activate the tab. Nore this will not work in xl2007
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2010 & 2007
    Posts
    210

    Re: Activate button upon checkbox selection in custom ribbon

    Wow Andy sir!!
    http://mvp.microsoft.com/en-us/mvp/Andy%20Pope-10110

    Thank you so much!! It's truely awesome!!

  5. #5
    Forum Contributor
    Join Date
    10-02-2008
    Location
    Berkeley, CA
    MS-Off Ver
    Windows 2007
    Posts
    105

    Re: Activate button upon checkbox selection in custom ribbon

    Go here to see Ron de Bruin's Enable or Disable custom Ribbon buttons in Excel 2007-2013"
    http://www.rondebruin.nl/win/s2/win013.htm


    I imagine that it will solve your problem.

    Mac

+ 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] Activate custom Ribbon Tab on Workbook Open
    By jewelsharma in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2014, 09:10 PM
  2. [SOLVED] Run Logon button under custom ribbon tab using VBA
    By v2k2apj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2013, 04:09 PM
  3. Populate dropDown in a custom ribbon on clicking a button
    By johnjacobt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2011, 05:02 AM
  4. Custom ribbon button will not check checkboxes
    By ericsastud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2010, 03:43 PM
  5. Assigning a macro to a custom button in 2007 ribbon
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2009, 05:50 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