I'd like Formula Bar & Status Bar closed when workbook opens.

  • Thread starter Thread starter Marvin Hlavac
  • Start date Start date
M

Marvin Hlavac

I would like to somehow make sure no tool bar opens when my workbook opens.
How to do this with Formula Bar and Status Bar??? With other tool bars I use
this:


Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CommandBars("Worksheet Menu Bar").Enabled = False
Application.CommandBars("Standard").Enabled = False
Application.CommandBars("Formatting").Enabled = False
Application.CommandBars("Drawing").Enabled = False
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.CommandBars("Standard").Enabled = True
Application.CommandBars("Formatting").Enabled = True
Application.CommandBars("Drawing").Enabled = True
End Sub


Any help will be greatly appreciated.
 
Hi Marvin:

Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False

You can figure this out by doing it through Tools | Options :-).

Regards,

Vasant.
 
Hi Vasant,
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False

That did it !!! I already put it to two workbooks I needed it for. It may be
simple for you, but I spent looong time today... Thanks a million again
Vasant !!! I knew chances were high you would be the first one with an
answer for me. I owe you big time for your help over the last couple of
months.

--
Regards,
Marvin Hlavac
Toronto, Canada
 
I owe you big time for your help over the last couple of months.<<

I do accept Canadian dollars <vbg> ... just kidding, Marvin! Glad to help.

Regards,

Vasant.
 
I do accept Canadian dollars <vbg> ... just kidding, Marvin! Glad to help.

Regards,

Vasant.


One of the workbooks I needed it for was a project for my wife I just
finished. It'll do payroll for her little business. Your name does deserve
to be there!!!

Thanks again
 
Note that in MacXL at least, FullScreen mode doesn't hide the
worksheet menu bar as the OPs code does (and it enables a toolbar
with a control for terminating full-screen mode).

OTOH, the OP's code wouldn't work for me because I disable the
standard toolbar and replace it with a custom toolbar in a startup
add-in.
 
Oops- criticized without a solution of my own:

The only one I can think of is to loop through the commandbars
collection and set .enable to off for each.
 
Thanks J.E. I missed the MenuBar in the op's code. I just mentioned it
because it appears "FullScreen" mode remembers what toolbars it hid. In
Windows, FullScreen also displays the Menu Bar. What I have done on my
system is added the "FullScreen" toolbar button to my Worksheet Menu Bar,
and closed the "FullScreen" toolbar button that pops up when in FullScreen.

I've never removed everything, but it does give one a little more real
estate. That is pretty neat. The following seems to work ok. The only
slight advantage I see here vs. looping is that one does not have to
remember what toolbar buttons were active.

Sub ToggleAllToolBars()
With Application
.DisplayFullScreen = Not .DisplayFullScreen
.CommandBars("Worksheet Menu Bar").Enabled = Not .DisplayFullScreen
End With
End Sub
 
Nice, Dana!

Regards,

Vasant.

Dana DeLouis said:
Thanks J.E. I missed the MenuBar in the op's code. I just mentioned it
because it appears "FullScreen" mode remembers what toolbars it hid. In
Windows, FullScreen also displays the Menu Bar. What I have done on my
system is added the "FullScreen" toolbar button to my Worksheet Menu Bar,
and closed the "FullScreen" toolbar button that pops up when in FullScreen.

I've never removed everything, but it does give one a little more real
estate. That is pretty neat. The following seems to work ok. The only
slight advantage I see here vs. looping is that one does not have to
remember what toolbar buttons were active.

Sub ToggleAllToolBars()
With Application
.DisplayFullScreen = Not .DisplayFullScreen
.CommandBars("Worksheet Menu Bar").Enabled = Not .DisplayFullScreen
End With
End Sub
 
Back
Top