I'm trying to assign a macro to a button within a customized Ribbon. When the following code is copied into a Module within the active Workbook, the button works fine. However, when the same code is copied to a module within Personal.XLSB, I get the following error message in Excel:
"Cannot run the macro 'rxbtnTest_Click'. The macro may not be available in this workbook or all macros may be disabled"
Macro Settings is set to "Enable all macros". Basically, I'd like to use macros saved in Personal.XLSB rather than have to rely on macros saved in the current workbook only.
Here is the text from the UI Editor:
<group id="Navigation"
label="Navigation">
<button id="rxbtnTest"
label="Test"
imageMso="CreateReportFromWizard"
onAction="rxbtnTest_Click"/>
</group>
VBA Code for Macro "Test"
'Callback for rxbtnTest onAction
Sub rxbtnTest_Click(control As IRibbonControl)
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
Selection.NumberFormat = "$#,##0"
End Sub
Bookmarks