Consulting

Results 1 to 2 of 2

Thread: Dynamic Ribbon Button

  1. #1

    Dynamic Ribbon Button

    I'm trying to create an Excel Ribbon button that only shows based on certain criteria. So, for example, the button might show on my PC but not on yours (based on network userid).

    I can find plenty of help on the web for creating dynamic buttons where you can programmatically assign functions and dropdowns to a button. But I cannot seem to find any help on how to create a button that, in some instances, does not show at all. Any help is appreciated.

  2. #2
    A button has a getVisible callback:

    [vba]<button id="Button1" label="Button1" getVisible="Button1_GetVisible">[/vba]

    Then in your workbook, insert the callback code:
    [vba]Private Sub Button1_GetVisible(control as IRibbonControl, ByRef returnedVal)
    'To hide button:
    returnedVal=False
    End Sub[/vba]
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

Posting Permissions

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