View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
pobuckley[_2_] pobuckley[_2_] is offline
external usenet poster
 
Posts: 1
Default Hiding all Toolbars

Hi all

Below is the code I have used to hide/unhide all the toolbars in excel


It falls in that the tabs at the end of the page seem to be hidde
below the taskbar containing my Start button, timer etc.

Also, I have an exit button which simply calls ActiveWorkbook.Close
but it does not fully close the instance of excel, it closes th
workbook and hides the X button on the top right of the screen.

Any ideas? Thanks in advance. My code is:



Dim CurrentToolSet(20) As Boolean
' Static Flag As Boolean
Dim i As Integer
Private Sub Workbook_Open()
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Enabled = True

Application.CommandBars.ActiveMenuBar.Enabled = False
ActiveWindow.DisplayHeadings = False
' Loop through all of the toolbars.
For i = 1 To Application.Toolbars.Count

' Restore toolbar setting to the original value as saved in
' the array.
CurrentToolSet(i) = Application.Toolbars(i).Visible
Application.Toolbars(i).Visible = False
' End of loop.
Next i
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

'This command, coupled with setting the screen to full screen an
hiding the full screen toolbar will give you
'a non-Excel look:
Application.DisplayFullScreen = False
Application.CommandBars("Full Screen").Enabled = False

Application.CommandBars.ActiveMenuBar.Enabled = True
ActiveWindow.DisplayHeadings = True
' Loop through all of the toolbars.
For i = 1 To Application.Toolbars.Count

' Store the visible property of each toolbar in the array
' CurrentToolSet.
Application.Toolbars(i).Visible = CurrentToolSet(i)
' End of loop.
Next i
Application.WindowState = xlNormal
Application.WindowState = xlMaximized

End Su

--
Message posted from http://www.ExcelForum.com