LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Remove custom menu

I have a custom menu which appears as a menu item in the worksheet menu bar
whenever this spreadsheet is opened. This menu itm is supposed to be visible
when the spreadsheet is activated and disappear when another spreadsheet is
activated. I am using Excel 2003.

The code for adding the menu is in the ThisWorkbook code module within
Sub Workbook_Activate().

The code for removing the menu is in the ThisWorkbook code module within
Sub Workbook_Deactivate().

In each case the code in ThisWorkbook calls routines within the main macro
modules.

The code in the main macro module for removing the menu is:
CommandBars("Worksheet Menu Bar").Controls("MyMenu").Delete

The problem is that when another spreadsheet is opened whilst this one is
open, the custom menu item is not disappearing, although the newly opened
spreadsheet is obviously the one that becomes the active one.

Is there any way that the removal of the custom menu can be more robust?

Thanks.
--
Partho
 
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 Context menu (Right click menu) not working in sheet changeevent. Madiya Excel Programming 3 February 11th 08 01:24 PM
Create/Remove Custom Menu Items from Add-in Michael Malinsky[_2_] Excel Programming 8 April 9th 05 01:01 PM
Remove custom menu Excel Discussion (Misc queries) 5 March 8th 05 05:06 PM
Custom Menu return to Excel Menu upon Closing VetcalcReport Excel Programming 2 August 2nd 04 02:59 PM
Window's System Menu, can't remove menu Yury Lobanov Excel Programming 3 December 28th 03 11:55 AM


All times are GMT +1. The time now is 08:23 AM.

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

About Us

"It's about Microsoft Excel"