cagataybaser
09-17-2014, 05:19 AM
Hello everyone,I created a custom ribbon for myself using xml
I have a part in xml code like this
<checkBox id = "Fnew" getLabel="CallbackGetLabel" getPressed="GetPressed" onAction="KOLONAC" />
and vba code for this part is
Dim bChk(0 to 2) As Boolean
Public objRibbon As IRibbonUI
Private Sub o n l o a d(ribbon As IRibbonUI)
Dim i As Long
Set objRibbon = ribbon
bChk(0) = True
End Sub
Function GetChkBox(ByVal sString) As String
Select Case sString
Case "Fnew"
GetChkBox = "0"
End Select
End Function
Sub GetPressed(control As IRibbonControl, ByRef Button)
Button = bChk(GetChkBox(control.ID))
End Sub
Sub CallbackGetLabel(control As IRibbonControl, ByRef Label)
On Error Resume Next
Select Case control.ID
Case "Fnew"
Label = Range("B12").Value
End Select
End Sub
And when I change range("b12").value with another macro,getpressed is not shown anymore.
Can you help me about that?
Best Regards
I have a part in xml code like this
<checkBox id = "Fnew" getLabel="CallbackGetLabel" getPressed="GetPressed" onAction="KOLONAC" />
and vba code for this part is
Dim bChk(0 to 2) As Boolean
Public objRibbon As IRibbonUI
Private Sub o n l o a d(ribbon As IRibbonUI)
Dim i As Long
Set objRibbon = ribbon
bChk(0) = True
End Sub
Function GetChkBox(ByVal sString) As String
Select Case sString
Case "Fnew"
GetChkBox = "0"
End Select
End Function
Sub GetPressed(control As IRibbonControl, ByRef Button)
Button = bChk(GetChkBox(control.ID))
End Sub
Sub CallbackGetLabel(control As IRibbonControl, ByRef Label)
On Error Resume Next
Select Case control.ID
Case "Fnew"
Label = Range("B12").Value
End Select
End Sub
And when I change range("b12").value with another macro,getpressed is not shown anymore.
Can you help me about that?
Best Regards