misi01
New member
I have experimented with this back and forth and can't figure out what to do (and I'm guessing the answer is trivial. Ho-hum).
Here's my callback
What I want to be able to do is to call this procedure from another one. For example, assume the user selects a user defined button from the ribbon that updates sheet 1. At the end of this procedure, I want to be able to update the Toggle_subtotals button. This is defined as
If I manually click on the button, everything works fine. My problem is that I "can't" call this procedure without passing the control argument and I don't know how to do that.
Here is the code I'm using (which doesn't work)
and
The various commented lines indicate variations I've tried (that didn't work either)
Suggestions gratefully received.
Here's my callback
Code:
'Callback for Toggle_subtotals onAction
Private Sub Toggle_subtotals_click(control As IRibbonControl)
Select Case bButtonClicked
Case True
' They've inserted subtotals - remove then
bButtonClicked = False
Range("Subtotals_exist").Value = 0 ' Update the technical sheet with whether subtotals exist on sheet 1 (they don't)
Application.ScreenUpdating = False
Call Module1.remove_subtotals("")
Application.ScreenUpdating = True
Case False
' Insert subtotals
bButtonClicked = True
Range("Subtotals_exist").Value = 1 ' Update the technical sheet with whether subtotals exist on sheet 1 (they do)
Application.ScreenUpdating = False
Call Module1.create_outline_groups("")
Application.ScreenUpdating = True
End Select
' Invalidate the control so that the label/icon are updated
rxIRibbonUI.InvalidateControl (control.ID)
End Sub
Code:
<button id="Toggle_subtotals"
keytip="T3"
getImage="rxbtnProcess_getImage"
getLabel="rxlblFeedback_getLabel"
onAction="Toggle_subtotals_click"/>
Here is the code I'm using (which doesn't work)
Code:
Sub test_ribbon()
Call Ribbon_modules.refresh_ribbon("")
End Sub
Code:
Sub refresh_ribbon(dummy As String)
' Invalidate the ribbon so that the label/icon is updated
' rxIRibbonUI.Invalidate
bButtonClicked = Range("Subtotals_exist").Value
Call Toggle_subtotals_click("Toggle_subtotals")
' rxIRibbonUI.InvalidateControl ("Toggle_subtotals")
End Sub
Suggestions gratefully received.