Hide Menus
Thanks a lot for your help.
I was actually given this bit of code by another user which works well -
except that I cannot figure out how to undo it, would you know?
Also this code does not disbale the possibility of changing the sheet names
- which completely stuffs up everything. Is this also possible?
Thanks a lot
LiAD
Private mFormulaBar
Private Sub Workbook_BeforeClosex()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB
Application.DisplayFormulaBar = mFormulaBar
End Sub
Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB
mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub
"Stephen C" wrote:
If you are using Excel 97-2003
I use the following codes in Private Sub Workbook_Activate() in this workbook
You will need to enable the menus when exiting the spreadsheet therefore
change the code from = false to = true in Private Sub Workbook_Deactivate()
You will need to make sure that all users have macros enabled.
"LiAD" wrote:
Hi,
I am trying to make several worksheets ' fiddle proof'. I have sheets that
contain macros which will unlock the worksheets, perform the calculation
thats needed, updated the data then relock the worksheet from the click on a
macro. Thats fine.
I just realised however that it is very simple ro ruin everything with a
simple right click on the sheet tab to delete sheets, change code etc etc.
How I eliminate this possibility?
Hide the sheet tabs in ToolsOptions then disable the menu
Application.CommandBars("Worksheet Menu Bar").FindControl _
(ID:=522, Recursive:=True).Enabled = False
Disable delete sheet
Application.CommandBars("Worksheet Menu Bar").FindControl _
(ID:=847, Recursive:=True).Enabled = False
Protect your code with a password
I also have a third sheet which at the moment I've hidden. However if a
user reinstalls the menu, he goes to format unhide sheet and the magic sheet
pops up. Is there a way of stopping this as well?
Disable sheet in the format menu
Application.CommandBars("Worksheet Menu Bar").FindControl _
(ID:=30026, Recursive:=True).Enabled = False
Thanks
|