View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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