ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Disabling Tools/Options setting (https://www.excelbanter.com/excel-discussion-misc-queries/259493-disabling-tools-options-setting.html)

Jeronimo

Disabling Tools/Options setting
 
Can anyone help me to find the VBA code to disable the Tools/Options setting.
This to avoid that the user of a model can change the original setting of a
model.

Many Thanks
Jeronimo

FSt1

Disabling Tools/Options setting
 
hi
to disable.....
Sub disableoptions()
Dim myControls As CommandBarControls
Dim ctl As CommandBarControl
Set myControls = CommandBars.FindControls _
(Type:=msoControlButton, ID:=522) '522=options
For Each ctl In myControls
ctl.Enabled = True
Next ctl
End Sub

to enable....
change false to true and run code again.

regards
FSt1

"Jeronimo" wrote:

Can anyone help me to find the VBA code to disable the Tools/Options setting.
This to avoid that the user of a model can change the original setting of a
model.

Many Thanks
Jeronimo


FSt1

Disabling Tools/Options setting
 
hi
after thought
see this site for a complete list of control id numbers 2003 and earlier.
not sure about 07
http://support.microsoft.com/kb/213552

regards
FSt1

"FSt1" wrote:

hi
to disable.....
Sub disableoptions()
Dim myControls As CommandBarControls
Dim ctl As CommandBarControl
Set myControls = CommandBars.FindControls _
(Type:=msoControlButton, ID:=522) '522=options
For Each ctl In myControls
ctl.Enabled = True
Next ctl
End Sub

to enable....
change false to true and run code again.

regards
FSt1

"Jeronimo" wrote:

Can anyone help me to find the VBA code to disable the Tools/Options setting.
This to avoid that the user of a model can change the original setting of a
model.

Many Thanks
Jeronimo


FSt1

Disabling Tools/Options setting
 
hi
sorry. i got everything backwards
to disable set ctl.Enabled = false
to enable set ctl.Enabled = True

sorry about that.
regards
FSt1

"FSt1" wrote:

hi
to disable.....
Sub disableoptions()
Dim myControls As CommandBarControls
Dim ctl As CommandBarControl
Set myControls = CommandBars.FindControls _
(Type:=msoControlButton, ID:=522) '522=options
For Each ctl In myControls
ctl.Enabled = True
Next ctl
End Sub

to enable....
change false to true and run code again.

regards
FSt1

"Jeronimo" wrote:

Can anyone help me to find the VBA code to disable the Tools/Options setting.
This to avoid that the user of a model can change the original setting of a
model.

Many Thanks
Jeronimo



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

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