Reputation: 1
I simply can't make this work, new to this customazible ribbon thingy I want 2 toggle buttons, so when one is click it changes the state of the other to this, button1 changes the cell value to 1, button2 the value to 2
also, start state of buttons should be button1 true button2 false can anyone help out, please? i do not know how to make this work, should be simple by googling
thank you (the codes below are butchered because i lost my track on what am i even doing)
in workbook module
Private myRibUI As IRibbonUI
Private statecheck1 As Boolean
Private statecheck2 As Boolean
Public Property Let ribbonUI(irib As IRibbonUI)
Set myRibUI = irib
End Property
Public Property Get ribbonUI() As IRibbonUI
Set ribbonUI = myRibUI
End Property
Public Property Let check1state(xval As Boolean)
statecheck1 = xval
End Property
Public Property Get check1state() As Boolean
check1state = statecheck1
End Property
Public Property Let check2state(xval As Boolean)
statecheck2 = xval
End Property
Public Property Get check2state() As Boolean
check2state = statecheck2
`End Property
in standard module
Sub loaded(ribbon As IRibbonUI)
ThisWorkbook.ribbonUI = ribbon
End Sub
Sub test()
ThisWorkbook.check1state = False
ThisWorkbook.check2state = True
ThisWorkbook.ribbonUI.InvalidateControl "toggle1"
ThisWorkbook.ribbonUI.InvalidateControl "toggle2"
End Sub
Upvotes: 0
Views: 13