Hide all toolbars/menu bar when open file

G

Guest

Hi,

Hope someone can help me out here.

I would like to have all my toolbars/menubar go hidden when open the file
(say, newfile.xls); and then when restate all the toolbars/ menubar when i
close the file (by creating a macro button to perform such task).

Thanks

Robin
 
I

Incidental

Hi Robin

You could do it using the code below.

Option Explicit
'you could also put the button event in the beforeclose event of the
workbook module to save you having to remember to do it.

Private Sub CommandButton1_Click()
Application.DisplayFullScreen = False
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End Sub

Private Sub Workbook_Open()
Application.DisplayFullScreen = True
Application.CommandBars("Worksheet Menu Bar").Enabled = False
End Sub


hope it helps

S
 
M

Mike Fogleman

Put this in the ThisWorkbook code module and try it.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayFullScreen = False
End Sub

Private Sub Workbook_Open()
Application.DisplayFullScreen = True
End Sub

Mike F
 
G

Guest

Hi Incidental,

Thanks for your reply.

I was wondering whether without using a button, the macro works when i open
the file. I do not want my user to consciously hide away the
toolbars/menubar.

Hope you can teach me how as I dont really know how to do that ...

As for restating back the toolbars when they try to quit my file, i can use
the button macro programming.

Thanks in advance!

Robin
 
G

Guest

Hi All,

I have combined Mike's suggestion solution and Incidental's ... seem to be
working towards my goal.

But there is the fullscreen toolbar appearing on my worksheet, at the press
of the button all the toolbars showed up. Is there a way not to let the
Fullscreen toolbar shows up on my screen?

Thanks everyone!

Robin
 
I

Incidental

Hi Robin

if you put the following code in the "Thisworkbook" module it will
automatically change when you open the file

Option Explicit

Private Sub Workbook_Open()
Application.DisplayFullScreen = True
Application.CommandBars("Worksheet Menu Bar").Enabled = False
End Sub

S
 
G

Guest

Hi S,

Thanks for the solution. Exactly what i was looking for. One small thing - I
wish the fullscreen toolbar does not show up on the screen for my user(s) to
click on it. I would like them to use the spreadsheet without coming out from
the fullscreen.

Thanks

Robin
 
I

Incidental

Hi Robin

Sorry for the late reply, you could use

Application.CommandBars("Full Screen").Visible = False

hope this helps you out

S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top