M
Murray
Greetings
The following piece of code works fine:
CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save
&As...").Enabled = False
However, if I change it to try and disable the Hyperlink menu item, it
will not work:
CommandBars("Worksheet Menu
Bar").Controls("Insert").Controls("Hyperl&ink...).Enabled = False
I then attempted to do it by brute force with equal lack of success:
For Each m1 In Application.CommandBars(1).Controls
For Each m2 In m1.Controls
If m2.Caption = "Hyperl&ink..." Then
m2.Enabled = False
End If
Next m2
Next m1
Can anyone please explain to me why these methods fail to disable the
Hyperlink menu item, and if there is a way to do it?
Thanks and regards
Murray
The following piece of code works fine:
CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save
&As...").Enabled = False
However, if I change it to try and disable the Hyperlink menu item, it
will not work:
CommandBars("Worksheet Menu
Bar").Controls("Insert").Controls("Hyperl&ink...).Enabled = False
I then attempted to do it by brute force with equal lack of success:
For Each m1 In Application.CommandBars(1).Controls
For Each m2 In m1.Controls
If m2.Caption = "Hyperl&ink..." Then
m2.Enabled = False
End If
Next m2
Next m1
Can anyone please explain to me why these methods fail to disable the
Hyperlink menu item, and if there is a way to do it?
Thanks and regards
Murray