Hide or show ribbon bar buttons

Add-in Express™ Support Service
That's what is more important than anything else

Hide or show ribbon bar buttons
 
Glen Lewis




Posts: 20
Joined: 2021-03-12
I have a setting pane, and if certain values are not set. I hide the several buttons in the ribbon bar. But how can I set the buttons back to visible once the values have been set and a connect button is clicked.

The example here:
Setting Pane
Api URL: https://localhost/
button: Connect

if the Connect button is successful then I want to set the visibility of the buttons back to true. I don't want to have to ask the user to close and reopen excel for the ribbon bar to reinit and show the buttons based off the new settings.
Posted 18 Apr, 2021 11:21:55 Top
Andrei Smolin


Add-in Express team


Posts: 18008
Joined: 2006-05-11
Hello Glen,

You change the visibility of the button using ADXRibbonButton.Visible = true/false.

Note that this changes the visibility of all instances of that button shown in other windows of the host application. If you need to have different visibility on some button instances, check section Updating custom Ribbon controls at run time; see the PDF file in the folder {Add-in Express}\Docs on your development PC.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 19 Apr, 2021 03:27:53 Top
Glen Lewis




Posts: 20
Joined: 2021-03-12
How do I access the ADXRibbonButton instance from a task pane button control?
Posted 19 Apr, 2021 08:06:38 Top
Andrei Smolin


Add-in Express team


Posts: 18008
Joined: 2006-05-11
An ADXRibbonButton is a component located on the add-in module. You access it using this code path:

{add-in project name such as MyAddin1}.AddinModule.CurrentInstance.{property or method declared on the add-in module such as ExcelApp}

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 19 Apr, 2021 09:44:01 Top