ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disable the Tool menu in toolbar (https://www.excelbanter.com/excel-programming/359090-disable-tool-menu-toolbar.html)

Sameh Farouk

disable the Tool menu in toolbar
 
I have a workbook with severalworksheets,and many users use this workbook
I have a macro for protecting and unprotecting ,and disabling the users from
deleting rows ,etc. but I found that some users have the security adjusted to
high so macro is disabled and some others have the ability to go to macro and
unprotect the sheet and also know the password,so is there a way to
1) when a user open the workbook,the security level adjusted to medium
2) the Tool menu in the menu bar be disabled
Thanks to all for your help
Best regards
--
Sameh Farouk

AA2e72E

disable the Tool menu in toolbar
 
2)

application.CommandBars.Item("Tools").Enabled = False ' disables the dropdown
application.CommandBars.Item("Tools").Visible =False ' hides the option

"Sameh Farouk" wrote:

I have a workbook with severalworksheets,and many users use this workbook
I have a macro for protecting and unprotecting ,and disabling the users from
deleting rows ,etc. but I found that some users have the security adjusted to
high so macro is disabled and some others have the ability to go to macro and
unprotect the sheet and also know the password,so is there a way to
1) when a user open the workbook,the security level adjusted to medium
2) the Tool menu in the menu bar be disabled
Thanks to all for your help
Best regards
--
Sameh Farouk


L Scholes

disable the Tool menu in toolbar
 
Is there a way to do this with File "Save", but leave "Save As"


AA2e72E

disable the Tool menu in toolbar
 
Yes!

Application.CommandBars.Item("File").Controls.Item ("Save &AS...").Enabled =
False ' Disable option
Application.CommandBars.Item("File").Controls.Item ("Save &AS...").Visible =
False ' Hide option

!Type "Save &AS..." as shown!

"L Scholes" wrote:

Is there a way to do this with File "Save", but leave "Save As"



AA2e72E

disable the Tool menu in toolbar
 
I think I disabled/made hidden Save AS instrad of Save;for Save use "&Save"
insead of "Save&AS..." within the code.



"AA2e72E" wrote:

Yes!

Application.CommandBars.Item("File").Controls.Item ("Save &AS...").Enabled =
False ' Disable option
Application.CommandBars.Item("File").Controls.Item ("Save &AS...").Visible =
False ' Hide option

!Type "Save &AS..." as shown!

"L Scholes" wrote:

Is there a way to do this with File "Save", but leave "Save As"



L Scholes

disable the Tool menu in toolbar
 
If I disable .Item(&Save), will I still be able to use "Ctrl+S" to save?


L Scholes

disable the Tool menu in toolbar
 
I tried to use your "Hide Option"
(Application.CommandBars.Item("File").Controls.Ite m("Save
&AS...").Visible =
False ' Hide option) and get an error message when I re-open the
workbook???


AA2e72E

disable the Tool menu in toolbar
 
Ctrl + S will still work: if you want to stop it working,you can do it by
trapping the key combination ... see onKey in the help files.

I do not get errors on re-opening the file ... using 2000

"L Scholes" wrote:

I tried to use your "Hide Option"
(Application.CommandBars.Item("File").Controls.Ite m("Save
&AS...").Visible =
False ' Hide option) and get an error message when I re-open the
workbook???



L Scholes

disable the Tool menu in toolbar
 
Oh, well. The rest of the code works!!! (I can't get the "Hide Option"
to work; tried everything! Don't worry about it. I'm using Excel 2002
SP3.)
Thank you!



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com