Hi,
I want to hide all the menus from excel sheet after password proteection. Menus like File, Edit, View, etc.
How can i do this? Please help me.
Thanks
Hi,
I want to hide all the menus from excel sheet after password proteection. Menus like File, Edit, View, etc.
How can i do this? Please help me.
Thanks
In my ever so humble opinion, you'll want to think this one through. To be decently effective for more than the casual user... I (again, just my opinion) believe you'll want to look at all shortcut key combos, then all the commandbars, as well as replacing (at min) the menubar, lest the user cannot do anything...
Does that make any sense?
Mark
Also remember that hiding menu's will affect the entire application, not just that workbook. You will need to carefully code it such that the menu's are restored (and not reset) each time the workbook is closed or deactivated.
Remmember that users may have customised menus so that I why I mention that reset is not appropriate.
May I ask, why do you want to hide these?
Regards,
Jon von der Heyden (Excel 2003, OS XP Pro)
Hi Jon :-)Originally Posted by JONvdHeyden
Wow(!), good point! I don't think I've ever 'violated' that , but I don't know that it would have occurred to me either...
Mark
[vba]
Option Explicit
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
[/vba]
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
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Hi Bob,
If a moment, wouldn't it be better to stick these in activate/deactivate?
Quite frankly, if I am missing something, your answer will be helpful, so figured better to ask than stare at the dang screen and wonder...
My thought is that this way if the user has 2(+) wb's open...
Thank you much,
Mark
I want this to give limited access to the user. User should not be able to save or save as the file or able to do any insert and edit operations.Originally Posted by JONvdHeyden
Hello again
You can probably achieve these restrictions using a combination of worksheet protection and macro. You can lock cells for editing and apply worksheet protection to stop users editing.
And you can use a macro to prevent a user from saving the workbook:
[VBA]Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
End Sub[/VBA]
Some sort of combination of this is safer than disabling the toolbars, in my humble opinion.
Regards,
Jon von der Heyden (Excel 2003, OS XP Pro)