Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
Is it possible to disable cut and copy functions in Excel through VBA codes? If yes could somebody show the codes please? Thank You. M Varnendra |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This is a way to disable Cuts (and Drag & Drop, which is the same thing).
You would have to enhance it yourself for copying. Sub CutsOff() AllowCuts False End Sub Sub CutsOn() AllowCuts True End Sub Sub AllowCuts(bEnable As Boolean) Dim oCtls As CommandBarControls, oCtl As CommandBarControl Set oCtls = CommandBars.FindControls(ID:=21) ''Cut If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If ''Disable Tools, Options so D&D cannot be restored Set oCtls = CommandBars.FindControls(ID:=522) If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If With Application .CellDragAndDrop = bEnable If bEnable Then .OnKey "^x" .OnKey "+{Del}" Else .OnKey "^x", "" .OnKey "+{Del}", "" End If End With End Sub -- Jim "Varne" wrote in message ... | Hi | | Is it possible to disable cut and copy functions in Excel through VBA codes? | | If yes could somebody show the codes please? | | Thank You. | | M Varnendra |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
That is brilliant. I am trying on stoppying copying . Many thanks. M Varnendra "Jim Rech" wrote: This is a way to disable Cuts (and Drag & Drop, which is the same thing). You would have to enhance it yourself for copying. Sub CutsOff() AllowCuts False End Sub Sub CutsOn() AllowCuts True End Sub Sub AllowCuts(bEnable As Boolean) Dim oCtls As CommandBarControls, oCtl As CommandBarControl Set oCtls = CommandBars.FindControls(ID:=21) ''Cut If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If ''Disable Tools, Options so D&D cannot be restored Set oCtls = CommandBars.FindControls(ID:=522) If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If With Application .CellDragAndDrop = bEnable If bEnable Then .OnKey "^x" .OnKey "+{Del}" Else .OnKey "^x", "" .OnKey "+{Del}", "" End If End With End Sub -- Jim "Varne" wrote in message ... | Hi | | Is it possible to disable cut and copy functions in Excel through VBA codes? | | If yes could somebody show the codes please? | | Thank You. | | M Varnendra |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry Jim
Still the user can cut using the icon bar. Is it possible to stop them? I have to submit an application tomorrow. If you do not mind please answer this question. Thanks Kind Regards M Varnendar "Varne" wrote: Hi Stopping Copying is also OK. If you do not mind I would like to receive professional service from you. Could you please send a mail to the following address? Thanks again. Kind Regards M Varnendra "Varne" wrote: Hi That is brilliant. I am trying on stoppying copying . Many thanks. M Varnendra "Jim Rech" wrote: This is a way to disable Cuts (and Drag & Drop, which is the same thing). You would have to enhance it yourself for copying. Sub CutsOff() AllowCuts False End Sub Sub CutsOn() AllowCuts True End Sub Sub AllowCuts(bEnable As Boolean) Dim oCtls As CommandBarControls, oCtl As CommandBarControl Set oCtls = CommandBars.FindControls(ID:=21) ''Cut If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If ''Disable Tools, Options so D&D cannot be restored Set oCtls = CommandBars.FindControls(ID:=522) If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If With Application .CellDragAndDrop = bEnable If bEnable Then .OnKey "^x" .OnKey "+{Del}" Else .OnKey "^x", "" .OnKey "+{Del}", "" End If End With End Sub -- Jim "Varne" wrote in message ... | Hi | | Is it possible to disable cut and copy functions in Excel through VBA codes? | | If yes could somebody show the codes please? | | Thank You. | | M Varnendra |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
To turn off the option in the edit menu
Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=19, Recursive:=True).Enabled = False Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=21, Recursive:=True).Enabled = False Also to turn off the commandbar with the cut/copy icon on Application.CommandBars("Standard").Enabled = False Remember to turn them back on when finished (Set false to true). Best to turn them off in a workbook_open event and turn them on in a workbook_beforeclose event in this workbook. "Varne" wrote: Sorry Jim Still the user can cut using the icon bar. Is it possible to stop them? I have to submit an application tomorrow. If you do not mind please answer this question. Thanks Kind Regards M Varnendar "Varne" wrote: Hi Stopping Copying is also OK. If you do not mind I would like to receive professional service from you. Could you please send a mail to the following address? Thanks again. Kind Regards M Varnendra "Varne" wrote: Hi That is brilliant. I am trying on stoppying copying . Many thanks. M Varnendra "Jim Rech" wrote: This is a way to disable Cuts (and Drag & Drop, which is the same thing). You would have to enhance it yourself for copying. Sub CutsOff() AllowCuts False End Sub Sub CutsOn() AllowCuts True End Sub Sub AllowCuts(bEnable As Boolean) Dim oCtls As CommandBarControls, oCtl As CommandBarControl Set oCtls = CommandBars.FindControls(ID:=21) ''Cut If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If ''Disable Tools, Options so D&D cannot be restored Set oCtls = CommandBars.FindControls(ID:=522) If Not oCtls Is Nothing Then For Each oCtl In oCtls oCtl.Enabled = bEnable Next End If With Application .CellDragAndDrop = bEnable If bEnable Then .OnKey "^x" .OnKey "+{Del}" Else .OnKey "^x", "" .OnKey "+{Del}", "" End If End With End Sub -- Jim "Varne" wrote in message ... | Hi | | Is it possible to disable cut and copy functions in Excel through VBA codes? | | If yes could somebody show the codes please? | | Thank You. | | M Varnendra |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The macro as written disables all Cuts as far as I know. What do you mean
by "icon bar"? -- Jim "Varne" wrote in message ... | Sorry Jim | | Still the user can cut using the icon bar. Is it possible to stop them? I | have to submit an application tomorrow. If you do not mind please answer this | question. | | Thanks | | Kind Regards | M Varnendar | | "Varne" wrote: | | Hi | | Stopping Copying is also OK. | | If you do not mind I would like to receive professional service from you. | Could you please send a mail to the following address? | | Thanks again. | | Kind Regards | M Varnendra | | "Varne" wrote: | | Hi | | That is brilliant. | | I am trying on stoppying copying . | | Many thanks. | M Varnendra | | "Jim Rech" wrote: | | This is a way to disable Cuts (and Drag & Drop, which is the same thing). | You would have to enhance it yourself for copying. | | Sub CutsOff() | AllowCuts False | End Sub | | Sub CutsOn() | AllowCuts True | End Sub | | Sub AllowCuts(bEnable As Boolean) | Dim oCtls As CommandBarControls, oCtl As CommandBarControl | Set oCtls = CommandBars.FindControls(ID:=21) ''Cut | If Not oCtls Is Nothing Then | For Each oCtl In oCtls | oCtl.Enabled = bEnable | Next | End If | ''Disable Tools, Options so D&D cannot be restored | Set oCtls = CommandBars.FindControls(ID:=522) | If Not oCtls Is Nothing Then | For Each oCtl In oCtls | oCtl.Enabled = bEnable | Next | End If | With Application | .CellDragAndDrop = bEnable | If bEnable Then | .OnKey "^x" | .OnKey "+{Del}" | Else | .OnKey "^x", "" | .OnKey "+{Del}", "" | End If | End With | End Sub | | | -- | Jim | "Varne" wrote in message | ... | | Hi | | | | Is it possible to disable cut and copy functions in Excel through VBA | codes? | | | | If yes could somebody show the codes please? | | | | Thank You. | | | | M Varnendra | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disabling formula | Excel Discussion (Misc queries) | |||
Disabling the cut function? | Excel Discussion (Misc queries) | |||
Disabling updatelinks | Excel Discussion (Misc queries) | |||
disabling the copy paste function in a cell | Excel Worksheet Functions | |||
disabling CUT function | Excel Discussion (Misc queries) |