Re: Cut button is disabled
- From: "Ron de Bruin" <rondebruin@xxxxxxxxxxxx>
- Date: Fri, 28 Sep 2007 18:54:01 +0200
If you copy the two events I posted in a work*** module you see that it will work only for that work***
Is it working for you?????????
From which Toolbar do you want to disable the items
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"Asif" <Asif@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:63C9812B-C542-4DE3-ABFD-A2B7E2C2E9BF@xxxxxxxxxxxxxxxx
Hi Ron,.
I do not want to disable ctrl-x for all office. I just want to do so in one particular work***. Also, any idea why i can't disable clear in the code below.
--
Thanx & regards,
Asif
"Ron de Bruin" wrote:
Oops, the last one(Deactivate) must be True instead of false
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"Ron de Bruin" <rondebruin@xxxxxxxxxxxx> wrote in message news:uB4REyeAIHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
> There are more problems with your code
> > To disable Cut for example in all toolbars use
> > Private Sub Worksheet_Activate()
> ' Excel 2000 - 2003
> Dim Ctrl As Office.CommandBarControl
> For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
> Ctrl.Enabled = False
> Next Ctrl
> End Sub
> > > Private Sub Worksheet_Deactivate()
> ' Excel 2000 - 2003
> Dim Ctrl As Office.CommandBarControl
> For Each Ctrl In Application.CommandBars.FindControls(ID:=21)
> Ctrl.Enabled = False
> Next Ctrl
> End Sub
> > > -- > > Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
> > > "Asif" <Asif@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:B3A3F396-D3E9-4BC1-BAB6-69D74E2789DE@xxxxxxxxxxxxxxxx
>>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" <Asif@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:75EB95F2-E7FA-4120-BAC2-0B9FA3914A7C@xxxxxxxxxxxxxxxx
>>> >I have used following code to disable cut in a work***. 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
>>>
- Follow-Ups:
- Re: Cut button is disabled
- From: Asif
- Re: Cut button is disabled
- References:
- Re: Cut button is disabled
- From: Ron de Bruin
- Re: Cut button is disabled
- From: Ron de Bruin
- Re: Cut button is disabled
- From: Ron de Bruin
- Re: Cut button is disabled
- From: Asif
- Re: Cut button is disabled
- Prev by Date: Re: How can I remove leading zeros?
- Next by Date: RE: complicated search and extract.... i think
- Previous by thread: Re: Cut button is disabled
- Next by thread: Re: Cut button is disabled
- Index(es):