I have a context menu that shows when the user right-clicks on the worksheet. When I added a 10th item to it, the menu option shows up but it will not call the sub that calls the module that writes the report. Checked the syntax and created a breakpoint at the menu item being called for both the new option and a working one. The code will just not run. Here is the code.
Code:
Set myItem = myBar.Controls.Add(Type:=msoControlButton)
With myItem
.Caption = "Base Hours Estimate..."
.OnAction = "HoursEstimateReport"
.FaceId = 4
'Indicate a new "group" by inserting a line.
'.BeginGroup = True
End With
'********************************************
'* HoursEstimateReport()
'*
'* Creates the hours estimate report for the
'* current schedule.
'********************************************
Sub HoursEstimateReport()
Dim actSheet As Worksheet
MsgBox "HoursEstimateReport"
'Set to active sheet
Set actSheet = Application.ActiveSheet
'If the current sheet is the cover sheet then
'show error message
If actSheet.name = FRONT_END_SHEET Then
MsgBox "You must be on a schedule sheet to generate this report...", vbInformation, "Can't Generate Report"
Else
'Generate the report
HoursEstimateReport.WriteReport
End If
End Sub