I set a new toggleButton to Excel ribbon:
<togglebutton
id="rxblockmacros"
getLabel="GetLabel"
size="large"
onAction="rxblockmacros_Click"
imageMso="AfterDelete"
screentip="Block / activate macros" />
Everything else works fine but not the label function.
I have tried tons of various ways, but it just doesn't change the text of the toggleButton. When I open that particular document, button will get the label from this function, depending on how I have set bLabelState.
Any idea what I could try?
</togglebutton>
<togglebutton
id="rxblockmacros"
getLabel="GetLabel"
size="large"
onAction="rxblockmacros_Click"
imageMso="AfterDelete"
screentip="Block / activate macros" />
Everything else works fine but not the label function.
Code:
Sub GetLabel(ByVal control As IRibbonControl, ByRef returnedVal)
Select Case control.ID
Case "rxblockmacros"
If bLabelState Then
returnedVal = "Activate macros"
Else
returnedVal = "Block macros"
End If
Case Else
' do nothing
End Select
Code:
Option Explicit
Public grxIRibbonUI As IRibbonUI
Private bLabelState As Boolean
'Callback for customUI.******
Sub rxIRibbonUI_******(ribbon As IRibbonUI)
Set grxIRibbonUI = ribbon
bLabelState = True
End Sub
</togglebutton>