Results 1 to 2 of 2

Thread: Refresh ribbon with code

  1. #1

    Refresh ribbon with code

    Register for a FREE account, and/
    or Log in to avoid these ads!

    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

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts