how to hide a worksheet menu bar so user can see full screen display.any ideas or something like cod


Posted by dunno on June 29, 2000 11:54 PM

thanks



Posted by Ryan on June 30, 0100 2:24 PM

Hey,
Here you go. Most of this code was borrowed from j-walk. I taylored it to your needs. Hope you like it. Put the Workbook_Open and WorkBook_BeforeClose procedures in the "ThisWorkbook" module, and the other code in a regular module (i.e. "Module1"). Let me know if it's what you wanted.
Ryan

Private Sub Workbook_Open()
Call HideAllToolbars
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not Me.Saved Then
Msg = "Do you want to save the changes you made to "
Msg = Msg & Me.Name & "?"
Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
Select Case Ans
Case vbYes
Me.Save
Case vbNo
Me.Saved = True
Case vbCancel
Cancel = True
Exit Sub
End Select
End If
Call RestoreToolbars
End Sub


Dim Bars() As String

Sub HideAllToolbars()
Dim TB As CommandBar
Dim TBNum As Integer
Dim TBSheet As Worksheet

Application.ScreenUpdating = False


' Hide all visible 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
ReDim Preserve Bars(TBNum)
Bars(TBNum) = TB.Name
End If
End If
Next TB
Application.ScreenUpdating = True
End Sub

Sub RestoreToolbars()
Application.ScreenUpdating = False

' Unhide the previously displayed the toolbars
On Error Resume Next
For x = 1 To UBound(Bars())
CommandBars(Bars(x)).Visible = True
Next x
Application.ScreenUpdating = True
End Sub