#1   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Custom Menu Issue.

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Custom Menu Issue.

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").Vis ible = False

End Sub

Private Sub Workbook_Deactivate()

Workbook_BeforeClose True

End Sub

Private Sub Workbook_Open()

Application.CommandBars("Your_Menu_Name_Here").Vis ible = True

End Sub

*************************************************
--
Kevin Backmann


"Ayo" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Custom Menu Issue.

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?

"Kevin B" wrote:

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").Vis ible = False

End Sub

Private Sub Workbook_Deactivate()

Workbook_BeforeClose True

End Sub

Private Sub Workbook_Open()

Application.CommandBars("Your_Menu_Name_Here").Vis ible = True

End Sub

*************************************************
--
Kevin Backmann


"Ayo" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom View issue - maybe even a bug?! baxybaxy Excel Discussion (Misc queries) 0 June 27th 06 04:00 PM
custom menu winqan Excel Discussion (Misc queries) 1 February 6th 06 10:51 AM
Custom Menu Help EAB1977 Excel Worksheet Functions 1 November 12th 05 01:02 AM
Custom menu Alan M Excel Worksheet Functions 4 September 18th 05 11:57 PM
Keep Custom Menu settings - help !! Anthony Excel Worksheet Functions 1 February 26th 05 12:11 AM


All times are GMT +1. The time now is 10:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"