View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tempy Tempy is offline
external usenet poster
 
Posts: 203
Default Help with - J.Walkenbachs code

Hi all, I got the code from J. Walkenbachs book and it works great, but
it does not hide the menu bar, could somebody tell my how i would modify
it to hide the menu bar as well ??

---------------------------------------------------------------------
Sub HideAllToolbars()
Dim TB As CommandBar
Dim TBNum As Integer
Dim TBSheet As Worksheet
Set TBSheet = Workbooks("Recon_Master.xls").Worksheets("TBSheet" )
Application.ScreenUpdating = False
' clear the sheet
TBSheet.Cells.Clear
'Hide all visable toolbars and store their names
TBNum = 0
For Each TB In CommandBars
If TB.Type = msoBarTypeNormal Then
If TB.Visible Then
TBNum = TBNum + 1
TB.Visible = False
TBSheet.Cells(TBNum, 1) = TB.Name
End If
End If
Next TB
Application.ScreenUpdating = True
addToolbar
End Sub
------------------------------------------------------------------------
-
Sub restoreToolbars()
Dim TBSheet As Worksheet
Dim cell As Range
Set TBSheet =
Workbooks("Recon_Master.xls").Worksheets("TBSheet" )
Application.ScreenUpdating = False
'unhide the previousely displayed toolbars
On Error Resume Next
For Each cell In TBSheet.Range("A:A") _
.SpecialCells(xlCellTypeConstants)
CommandBars(cell.Value).Visible = True
Next cell
Application.ScreenUpdating = True
End Sub


Tempy

*** Sent via Developersdex http://www.developersdex.com ***