Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to permantly delete a custom menu in excel
hi,
I met a very strange problem with Excel. Firstly I created a custom menu using the following VBA snippet Sub add_menu() Dim cmd_Bar As CommandBar Dim menu_Intranet As CommandBarControl Set cmd_Bar = Application.CommandBars("Worksheet Menu Bar") Set menu_Intranet = cmd_Bar.Controls.Add(Type:=10, Temporary:=True) menu_Intranet.Caption = "Intranet Entry" End Sub Then a custom menu appeared on the run time. However, after I closed the excel, and reopened it without running any VBA Code, the same menu appeared, which is very surprising. Then I used the following code to programmtically delete the menu, Sub delete_menu() Dim cmd_Bar As CommandBar Dim menu_Intranet As CommandBarControl Set cmd_Bar = Sheet1.Application.CommandBars("Worksheet Menu Bar") For Each menu_Intranet In cmd_Bar.Controls If menu_Intranet.Caption = "Intranet Entry" Then menu_Intranet.Delete End If Next End Sub Although such code can delete the menu on the run time as expected, when I close and reopne excel, the custom menu is still then. I would greatly appreciate if anyboday can tell me how to persuade this little baby to diappear permantly. Thanks in advance. -- John 3:16 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel 2007 add custom menu | Excel Discussion (Misc queries) | |||
Delete custom menu bars | Setting up and Configuration of Excel | |||
Adding Sub Menu Item to Current Custom Menu | Excel Programming | |||
How to delete Custom VBA Menu | Excel Programming | |||
Custom Menu return to Excel Menu upon Closing | Excel Programming |