#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Hide Menus

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?

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?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Hide Menus

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

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code




--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
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?

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?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Hide Menus

Works great! Thanks

One small point though, if I need to refind the menus to edit the file how
do I do that? As in how do I undo this?

Thanks


"Bob Phillips" wrote:

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

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code




--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
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?

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?

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Hide Menus

Hi,

I ahev just realised that the sheet names are still editable under this
format. Is it possible to lock those as well? If the sheet names can be
changed then that can shoot everything down.

Thanks
LiAD

"LiAD" wrote:

Works great! Thanks

One small point though, if I need to refind the menus to edit the file how
do I do that? As in how do I undo this?

Thanks


"Bob Phillips" wrote:

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

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code




--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
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?

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?

Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Hide Menus

Just realised I left some debug code in there, it should be

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
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

Other part

application.CommandBars(1).enabled=true


--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
Works great! Thanks

One small point though, if I need to refind the menus to edit the file how
do I do that? As in how do I undo this?

Thanks


"Bob Phillips" wrote:

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

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code




--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
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?

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?

Thanks








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Hide Menus

Not really, as there is no event triggered by this change. You could keep a
list of sheets on open, and have an asynch job checking them and resetting
if they get changed.

--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
Hi,

I ahev just realised that the sheet names are still editable under this
format. Is it possible to lock those as well? If the sheet names can be
changed then that can shoot everything down.

Thanks
LiAD

"LiAD" wrote:

Works great! Thanks

One small point though, if I need to refind the menus to edit the file
how
do I do that? As in how do I undo this?

Thanks


"Bob Phillips" wrote:

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

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code




--
__________________________________
HTH

Bob

"LiAD" wrote in message
...
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?

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?

Thanks





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide Menus LiAD Excel Discussion (Misc queries) 2 April 7th 09 02:17 PM
Hide menus etc in Excel 2007 Sandy Excel Programming 5 April 12th 08 04:59 PM
Hide Menus on a Workbook opening Siboneis Excel Programming 0 November 17th 04 12:46 AM
Hide/Delete XL Menus Rockee052[_40_] Excel Programming 4 February 18th 04 04:18 PM
Overriding Actions of Excel DropDown Menus and Poup Menus Von Shean Excel Programming 2 February 3rd 04 06:43 AM


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"