Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom Menu return to Excel Menu upon Closing
I would like to find out if there is a way to modify the following code to
restore the Excel Menu upon exiting the file. Your help would be sincerely appreciated! ____________Code Below ________________________ Private Sub CommandButton1_Click() ' Remove commandbars Dim bar As CommandBar For Each bar In Application.CommandBars bar.Enabled = False Next |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom Menu return to Excel Menu upon Closing
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim bar As CommandBar For Each bar In Application.CommandBars bar.Enabled = True Next End Sub Placed in the ThisWorkbook module. -- Regards, Tom Ogilvy "VetcalcReport" wrote in message ... I would like to find out if there is a way to modify the following code to restore the Excel Menu upon exiting the file. Your help would be sincerely appreciated! ____________Code Below ________________________ Private Sub CommandButton1_Click() ' Remove commandbars Dim bar As CommandBar For Each bar In Application.CommandBars bar.Enabled = False Next |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Custom Menu return to Excel Menu upon Closing
Hi
You can use events like this in the Thisworkbook module Private Sub Workbook_Activate() Dim bar As CommandBar For Each bar In Application.CommandBars bar.Enabled = False Next End Sub Private Sub Workbook_Deactivate() Dim bar As CommandBar For Each bar In Application.CommandBars bar.Enabled = True Next End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "VetcalcReport" wrote in message ... I would like to find out if there is a way to modify the following code to restore the Excel Menu upon exiting the file. Your help would be sincerely appreciated! ____________Code Below ________________________ Private Sub CommandButton1_Click() ' Remove commandbars Dim bar As CommandBar For Each bar In Application.CommandBars bar.Enabled = False Next |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel 2007 add custom menu | Excel Discussion (Misc queries) | |||
How do I save personal menu bar settings when closing program | Setting up and Configuration of Excel | |||
Excel 2000 Custom Menu Item | Excel Discussion (Misc queries) | |||
How do i save a custom footer in the excel drop down menu? | Excel Discussion (Misc queries) |