F
F W Green
Excel 2007 on Vista Business
I have created an XLSM file with a set of macros that I wish to deploy to
all computers in our firm. The XLSM file has the macros and a new Ribbon Tab
that I built with the Custom UI Editor. All the buttons on the Tab are
linked to the proper macros.
I saved the XLSM file as an XLAM and activated the XLAM as an addin. When I
open Excel, the new tab is visible on the Ribbon but when I click any of the
buttons, I get the error message:
"Cannot run the macro 'X'. The macro may not be available in this workbook
or all macros may be disabled.
I have pasted a sample of 1 of the macros from the VBA code at the bottom.
I have Macro Security set as:
- enable all Macros
- Trust access to the VBA project object model
If my process is incorrect or I have missed anything, your comments are most
appreciated.
Sample Macro:
'Callback for customButton1 onAction
Sub Preparer_signoff(control As IRibbonControl)
ActiveSheet.Range("B1:B3").Font.Size = 8
ActiveSheet.Range("B1").Activate
ActiveCell.Value = "PREPARER"
ActiveCell.Interior.ColorIndex = 45
ActiveSheet.Range("B2").Activate
ActiveCell.Font.Bold = True
'ActiveCell.Font.Color = RGB(0, 0, 200)
'1 black, 2 white, 3 red, 4 green, 5 blue, 6 yellow, 7 pink
'black
ActiveCell.Font.ColorIndex = 1
ActiveCell.Value = Application.UserName
ActiveSheet.Range("B3").Activate
ActiveCell.Font.Bold = True
'ActiveCell.Font.Color = RGB(0, 0, 0)
ActiveCell.Font.ColorIndex = 1
ActiveCell.NumberFormat = "yyyy-mm-dd;@"
ActiveCell.HorizontalAlignment = xlLeft
ActiveCell.Value = Date
End Sub
Thank you in advance.
Florian
I have created an XLSM file with a set of macros that I wish to deploy to
all computers in our firm. The XLSM file has the macros and a new Ribbon Tab
that I built with the Custom UI Editor. All the buttons on the Tab are
linked to the proper macros.
I saved the XLSM file as an XLAM and activated the XLAM as an addin. When I
open Excel, the new tab is visible on the Ribbon but when I click any of the
buttons, I get the error message:
"Cannot run the macro 'X'. The macro may not be available in this workbook
or all macros may be disabled.
I have pasted a sample of 1 of the macros from the VBA code at the bottom.
I have Macro Security set as:
- enable all Macros
- Trust access to the VBA project object model
If my process is incorrect or I have missed anything, your comments are most
appreciated.
Sample Macro:
'Callback for customButton1 onAction
Sub Preparer_signoff(control As IRibbonControl)
ActiveSheet.Range("B1:B3").Font.Size = 8
ActiveSheet.Range("B1").Activate
ActiveCell.Value = "PREPARER"
ActiveCell.Interior.ColorIndex = 45
ActiveSheet.Range("B2").Activate
ActiveCell.Font.Bold = True
'ActiveCell.Font.Color = RGB(0, 0, 200)
'1 black, 2 white, 3 red, 4 green, 5 blue, 6 yellow, 7 pink
'black
ActiveCell.Font.ColorIndex = 1
ActiveCell.Value = Application.UserName
ActiveSheet.Range("B3").Activate
ActiveCell.Font.Bold = True
'ActiveCell.Font.Color = RGB(0, 0, 0)
ActiveCell.Font.ColorIndex = 1
ActiveCell.NumberFormat = "yyyy-mm-dd;@"
ActiveCell.HorizontalAlignment = xlLeft
ActiveCell.Value = Date
End Sub
Thank you in advance.
Florian