View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default 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