office addin -Excel

Copper Contributor

hello everyone!

Is there a way to dynamically change the icon and label text in addin commands in custom tabs in a Ribbon? I've created an Excel command button (with manifest.xml) and want to change the icon and text whenever the user clicks on the button.

3 Replies
I'm not sure if you can do that. A trick might be to have multiple buttons with the correct icon and hide/unhide as appropriate. Not sure of that is possible either though. Perhaps this article gives you some pointers?
https://learn.microsoft.com/en-us/javascript/api/office/office.ribbon?source=recommendations&view=co...
unfortunately there is no such option to hide/unhide , only enable/disable option is there. actually iam looking for to create a login/ logout buttons
Well, I wonder because if I read this, it seems you can pass a ribbon specification as a JSON string:
https://learn.microsoft.com/en-us/javascript/api/office/office.ribbon?source=recommendations&view=co...)