Deleting "Arrange Side by Side with..." command from Window menuba

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good afternoon,

Can anyone suggest why I can delete all the other commands from the Windows
menu bar, apart from this one. I just want to be able to display the list of
currently open workbooks, but don't seem to be able to get rid of this
command.

The syntax I'm using is:

cbMainMenuBar.Controls("Window").Controls("Compare Side by Side
with...").Delete

Thanks in advance

Pete
 
If there is only one window, then this menu choice is disabled. So perhaps
this is the source of your problem.
 
Tom,

It's there, but it's greyed out - I would like to remove it altogether.

Cheers

Pete
 
try opening a second workbook (so two are opened) so it is not grayed. Then
see if you can delete it.
 
Is this working for you

Sub test()
Dim Ctl As CommandBarControl
For Each Ctl In Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=30009).Controls
On Error Resume Next
'Ctl.Enabled = False
Ctl.Delete
On Error GoTo 0
Next Ctl
End Sub

Sub test2()
Application.CommandBars("Worksheet Menu Bar").FindControl(ID:=30009).Reset
End Sub
 
Ron,

Absolutely superb! Thanks a lot.

I don't suppose you know where there's a definitive list of those IDs and
the controls that they apply to, is there? Do the IDs change for different
versions of Excel?

Thanks VERY much

Pete
 
Back
Top