Custom Menu Issue.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a custom mene that I assigned a macro to. But it keeps showing up
in other files.
How do I get it to show only in the workbook it was created for and not in
every other workbook.
 
In the workbook module, apply the following to the Activate/Deactivate
Open/Before close workbook triggers:
*************************************************
Private Sub Workbook_Activate()

Workbook_Open

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Application.CommandBars("Your_Menu_Name_Here").Visible = False

End Sub

Private Sub Workbook_Deactivate()

Workbook_BeforeClose True

End Sub

Private Sub Workbook_Open()

Application.CommandBars("Your_Menu_Name_Here").Visible = True

End Sub

*************************************************
 
I keep getting the "Invalid procedure call or argument" error on:
Application.CommandBars("Generate Report").Visible = True and
Application.CommandBars("Generate Report").Visible = False

What am I doing wrong?
 
Back
Top