Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a menu in code
I have VBA code that create's a new menu bar called "Process". The Code is
run when the worksheet opens. Problem is that it creates the menubar each time the worksheet opens thus giving me multiple identicle menus. I need some code to test to see if the menu has indeed been created, and if so not to create it again. I have tried several different things with no luck. Any help would be greatly appreciated. Thanks in advance. James D. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a menu in code
Dim cb as Commandbar
On error resume next set cb = Commandbars("Process") On Error goto 0 if cb is nothing then ' create Process commandbar end if If Process is not a commandbar, but a button or something, just adjuste the code, but the approach is the same. -- Regards, Tom Ogilvy "James D." wrote in message ... I have VBA code that create's a new menu bar called "Process". The Code is run when the worksheet opens. Problem is that it creates the menubar each time the worksheet opens thus giving me multiple identicle menus. I need some code to test to see if the menu has indeed been created, and if so not to create it again. I have tried several different things with no luck. Any help would be greatly appreciated. Thanks in advance. James D. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a menu in code
Before creating it, just delete it regardless
On Error Resume Next Application.Commandbars("Process").Delete On Error Goto 0 'now create anew -- HTH Bob Phillips (remove nothere from email address if mailing direct) "James D." wrote in message ... I have VBA code that create's a new menu bar called "Process". The Code is run when the worksheet opens. Problem is that it creates the menubar each time the worksheet opens thus giving me multiple identicle menus. I need some code to test to see if the menu has indeed been created, and if so not to create it again. I have tried several different things with no luck. Any help would be greatly appreciated. Thanks in advance. James D. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a menu in code
Many thx, this is what I needed.
"Bob Phillips" wrote: Before creating it, just delete it regardless On Error Resume Next Application.Commandbars("Process").Delete On Error Goto 0 'now create anew -- HTH Bob Phillips (remove nothere from email address if mailing direct) "James D." wrote in message ... I have VBA code that create's a new menu bar called "Process". The Code is run when the worksheet opens. Problem is that it creates the menubar each time the worksheet opens thus giving me multiple identicle menus. I need some code to test to see if the menu has indeed been created, and if so not to create it again. I have tried several different things with no luck. Any help would be greatly appreciated. Thanks in advance. James D. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating a menu in code
Many thx, this is what I needed.
"Tom Ogilvy" wrote: Dim cb as Commandbar On error resume next set cb = Commandbars("Process") On Error goto 0 if cb is nothing then ' create Process commandbar end if If Process is not a commandbar, but a button or something, just adjuste the code, but the approach is the same. -- Regards, Tom Ogilvy "James D." wrote in message ... I have VBA code that create's a new menu bar called "Process". The Code is run when the worksheet opens. Problem is that it creates the menubar each time the worksheet opens thus giving me multiple identicle menus. I need some code to test to see if the menu has indeed been created, and if so not to create it again. I have tried several different things with no luck. Any help would be greatly appreciated. Thanks in advance. James D. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating sub menu in Command bar | Excel Programming | |||
Menu Issues when creating an Add-in | Excel Programming | |||
Creating a menu | Excel Worksheet Functions | |||
Creating a drop-down menu | Excel Programming | |||
Creating a drop-down menu | Excel Programming |