I have a ribbon with a button and a label: the button opens up a data-entry form, and the label is supposed to show the environment. As I'm designing the ribbon XML everything's find until I add the attribute getLabel="modRibbon.GetEnvironment" to the <labelControl> element. Here are the ribbon XML and the whole VBA module named modRibbon.
When I leave out getLabel="modRibbon.GetEnvironment", all is well: the ribbon displays, the button works, and the label shows "Env". When I put it back in, the ribbon doesn't even display, and there's absolutely no clue anywhere as to what could possible be wrong, which is nothing whatsoever! I have followed all documentation scrupulously, and I have spent hours boiling it down to this one attribute, which, for no reason at all is the difference between the ribbon displaying and the ribbon not displaying.
What in hell could possibly possibly be wrong here? And where can I see any error messages?
Here's modRibbon:
When I leave out getLabel="modRibbon.GetEnvironment", all is well: the ribbon displays, the button works, and the label shows "Env". When I put it back in, the ribbon doesn't even display, and there's absolutely no clue anywhere as to what could possible be wrong, which is nothing whatsoever! I have followed all documentation scrupulously, and I have spent hours boiling it down to this one attribute, which, for no reason at all is the difference between the ribbon displaying and the ribbon not displaying.
What in hell could possibly possibly be wrong here? And where can I see any error messages?
XML:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="modRibbon.RibbonLoaded">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Deals">
<group id="customGroup" label="Maintenance">
<button id="customButton" label="Open" imageMso="CreateReportFromWizard" size="large" onAction="modRibbon.Start" />
<labelControl id="customLabel" label="Env" getLabel="modRibbon.GetEnvironment" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Here's modRibbon:
VBA Code:
Option Explicit
Option Private Module
Public Const ENV As String = "DEV"
Public myRibbon As IRibbonUI
Public Sub RibbonLoaded(ribbon As IRibbonUI) 'Callback for customUI.onLoad
Set myRibbon = ribbon
End Sub
Public Sub Start(control As IRibbonControl) 'Callback to load main form
frmMain.Show
End Sub
Public Sub GetEnvironment(control As IRibbonControl, ByRef label) 'Callback to supply the environment string
label = ENV
End Sub