Options Dialog Excel 2003

B

Bob Phillips

Disable the control?


CommandBars("Worksheet Menu
Bar").Controls("Tools").Controls("Options...").Enabled = False

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

Mike

The following code will disable the Tools - Options menu and can be put where
you want. One option is to put it in the workbook open event and have
corresponding code in the workbook before close event to re-enable the
controls.

Sub DeactivateIt()
With Application.CommandBars("Worksheet Menu Bar")
With .Controls("&Tools")
.Controls("&Options...").Enabled = False ' Change to true to
enable
End With
End With
End Sub

Mike
 
M

Mike

Sorry, I made it too complicated.

Sub DeactivateIt()
With Application.CommandBars("Worksheet Menu Bar").Controls("&Tools")
.Controls("&Options...").Enabled = False
End With
End Sub

Mike
 
G

gibsol

another question on this before I go ahead and enter VBA.
To show the options selection for my purposes only would I have to go into
VBA and change Enabled = False, to show Enabled = True.
 
B

Bob Phillips

Yes

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Gary Brown

Building on what Mike wrote, here are some macros for
disable/enable/hide/show...
'/================================/
Sub DeactivateIt()
With Application.CommandBars("Worksheet Menu Bar")
.Controls("&Tools").Controls("&Options...").Enabled = False
End With
End Sub
'/================================/
Sub ReactivateIt()
With Application.CommandBars("Worksheet Menu Bar")
.Controls("&Tools").Controls("&Options...").Enabled = True
End With
End Sub
'/================================/
Sub HideIt()
With Application.CommandBars("Worksheet Menu Bar")
.Controls("&Tools").Controls("&Options...").Visible = False
End With
End Sub
'/================================/
Sub ShowIt()
With Application.CommandBars("Worksheet Menu Bar")
.Controls("&Tools").Controls("&Options...").Visible = True
End With
End Sub
'/================================/


--
HTH,
Gary Brown
[email protected]
If this post was helpful to you, please select ''YES'' at the bottom of the
post.
 
G

gibsol

Sorry I did not read your first posting as you said it was to complex, but
that told me the answer I was asking for, and Thanks it works just as I
hoped. Thanks again
 
Top