Use this is better:
Sub MenuControl_Enabled_True()
Dim Ctl As CommandBarControl
Dim Cbar As Integer
Dim MyArray
Dim X As Byte
Application.ScreenUpdating = False
MyArray = Array(4, 19, 21, 22, 109, 186, 247, 259, 755, 841, 847
848, 859, 1561, 1695, 2019, 2040, 2045, 2046, 2047, 2048, 2188, 2521
3708, 30017, 3738, 5958, 30026, 30029, 30095, 30255)
On Error Resume Next
For Cbar = 1 To Application.CommandBars.Count
For Each Ctl In CommandBars(Cbar).Controls
For X = LBound(MyArray) To UBound(MyArray)
If Ctl.ID = MyArray(X) Then Ctl.Enabled = True
Application.CommandBars(Cbar).FindControl(ID:=MyAr ray(X)
Recursive:=True).Enabled = True
Next X
Next Ctl
Next Cbar
With Application
.OnKey "^c"
.OnKey "^v"
.OnKey "^p"
.OnKey "+{DEL}"
.OnKey "+{INSERT}"
.CellDragAndDrop = True
.OnKey "%{F11}"
End With
On Error GoTo 0
End Sub
Otherwise you may find many problems.
such us: duplicates controls on the same toolbar, RightClick (PLY )
edit/move or copy sheet, vba manpulation..
--
Message posted from
http://www.ExcelForum.com