Search code examples
excelribbon

How to get getEnabled callback method to run in VB.net Ribbon project


I have this XML code for a Ribbon button

<button id="Button9" label="Cover Index" image="cover"
                size="large" onAction="Viewcover" getEnabled="GetBEnabled" />

I'm using Visual Studio and inserted this getEnabled callback method in the callback Region as instructed

Public Sub GetBEnabled(ByVal control As Office.IRibbonControl, ByVal returnedVal As Boolean)

    returnedVal = True

End Sub

Although returnedVal is set to True, still the button is not enabled. What am I doing wrong?


Solution

  • I figured that the right syntax for getEnabled callback method in VB.net is:

    Function GetBEnabled(ByVal control As Office.IRibbonControl) As Boolean
    
        Return True
    
    End Function
    

    Thanks