Thread: menu bars
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default menu bars


Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"anon" wrote in message
oups.com...
Firstly my apologies for lots of posts - I am polishing up a nearly
completed sheet and so have lots of niggles that I need help with.

I currently use cells on a sheet of my workbook which activate VBA (in
a similar way that buttons might). However I am thinking I could do
this a much neater way - by using custom menus (which i have never
done before).

However to make it user friendly I would like to get rid of all other
menu commands and just have one menu - my own - which alongised my
custom commands would have the save and close features.

Is this possible? If so how would I go about doing this (if anybody
can point me to some online sites to help a newbie on this i would
appreciate it)

What happens if somebody had 2 excel sheets open at once - would mine
have the custom menu bar and the other have the normal menu bar, or
would the custom bar apply to them both?