The cut button remains permanently disabled but I can use ctrl-x in other
worksheets of the same workbook. The cut button gets restored after re-start.
--
Thanx & regards,
Asif
"Asif" wrote:
I have a similar routine re-enabling everything in the Worksheet_Deactivate
event. Still doesn't work.
--
Thanx & regards,
Asif
"Ron de Bruin" wrote:
Hi Asif
You must reset it in the Worksheet_Deactivate event
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"Asif" wrote in message ...
I have used following code to disable cut in a worksheet. But remains
disabled permanently for the workbook and even for other workbooks. I'd have
to re-start Excel to get it enabled. Is there a workaround... please help.
Private Sub Worksheet_Activate()
Dim eCtrl As CommandBarControl
On Error Resume Next
For Each eCtrl In Application.CommandBars
eCtrl.FindControls(ID:=21).Enabled = 0 'Disable Ctrl-x
eCtrl.FindControls(ID:=1964).Enabled = 0 'Disable Clear - All
eCtrl.FindControls(ID:=872).Enabled = 0 'Disable Clear - Formats
Next eCtrl
With Application
If .CutCopyMode = xlCut Then .CutCopyMode = False 'Clear clipboard
.OnKey "^x", ""
.CellDragAndDrop = False
.CopyObjectsWithCells = False
End With
End Sub
--
Thanx & regards,
Asif