I am using the following piece of XML code to create a custom Ribbon for an Excel add-in.
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="ComdinheiroTab" label="COMDINHEIRO">
<group id="ComdinheiroButtons" label="Comdinheiro">
<button id="Login" getLabel="getLabelLogin" image="Login" size="large" onAction="OnActionLogin"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
I am using the following VBA code to set a label for the button login:
Sub getLabelLogin(control As IRibbonControl, ByRef returnedVal)
if loggedIn = true then
returnedVal = "Logged"
else
returnedVal = "Disconected"
end if
End Sub
The label's name changes successfully according to the variable loggedIn's value when the ribbon is loaded. However I wish I could change the label's values during the execution of my program. Is it possible to call getLabel event using a VB code? Is there anyway to refresh my ribbon so this event would be called again?