I have been working on something similar!
The code to hide everything is below.
Private Sub Workbook_Open()
If Application.CommandBars("Worksheet Menu Bar").Enabled = True Then
Application.CommandBars("Worksheet Menu Bar").Enabled = False
End If
With ActiveWindow
.DisplayHeadings = False
.DisplayZeros = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With
With Application
.DisplayFormulaBar = False
.DisplayStatusBar = False
.ShowWindowsInTaskbar = False
End With
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Forms").Visible = False
End Sub
and to unhide (beforeclose event)
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Application.CommandBars("Worksheet Menu Bar").Enabled = False Then
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End If
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Forms").Visible = True
With ActiveWindow
.DisplayHeadings = True
.DisplayZeros = True
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
End With
With Application
.DisplayFormulaBar = True
.DisplayStatusBar = True
.ShowWindowsInTaskbar = True
End With
End Sub
I also added a button to show the menu to view the code etc.
Sub Show_menu()
If Application.CommandBars("Worksheet Menu Bar").Enabled = False Then
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End If
End Sub
Hope this helps!
PS visit
http://www.hungrybear.co.uk/compile2.zip to see how it works
This message was edited by Andy Gee on 2002-04-11 14:51