decadence
Well-known Member
- Joined
- Oct 9, 2015
- Messages
- 525
- Office Version
- 365
- 2016
- 2013
- 2010
- 2007
- Platform
- Windows
Hi, When invalidating the Ribbon control is there a way to enable multiple buttons from different groups on the ribbon?
I have followed Ron de Bruins example and have managed to make a group of buttons enable/disable based on column selection however I wish to add more buttons under this condition from another group of buttons on the same ribbon.
Code below uses the Tag for Group1 set of buttons but say if I wanted to Enable Group1, Group2 Button2, Group4 and Group5 button1 How can I invalidate the controls for these. Can someone help please
I have followed Ron de Bruins example and have managed to make a group of buttons enable/disable based on column selection however I wish to add more buttons under this condition from another group of buttons on the same ribbon.
Code below uses the Tag for Group1 set of buttons but say if I wanted to Enable Group1, Group2 Button2, Group4 and Group5 button1 How can I invalidate the controls for these. Can someone help please
VBA Code:
Sub MyEnableGroup1()
Call RefreshRibbon(Tag:="Group1*")
End Sub
Sub RefreshRibbon(Tag As String)
MyTag = Tag
If iRib Is Nothing Then
MsgBox "Error, Save/Restart your workbook"
Else
iRib.Invalidate
End If
End Sub
Sub GetEnabled(control As IRibbonControl, ByRef Enabled)
If control.Tag Like MyTag Then
Enabled = True
Else
Enabled = False
End If
End Sub