Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Disabling Cut and Copy

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Disabling Cut and Copy

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Disabling Cut and Copy

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Disabling Cut and Copy

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 51
Default Disabling Cut and Copy

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Disabling Cut and Copy

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
|
|
|


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Disabling Cut and Copy

Thanks Stephen

Icon problem solved. Thanks. OK.

However;

Using Jim's solution I was able to turn off keys x and c to stop "Ctrl + x"
and "Cntrl + c" without changing ID numbers 21 or 522. I just had to insert c
for x to prevent "Cntr + c".

After trying yours "cut" goes off the menu but I cannot guess how to take
off "copy" in the menu. The user can use it. Is there any way to stop it?
Perhaps by putting in another two lines with another ID? Could you please
inform?

Thanks.

M Varnendra

"Stephen C" wrote:

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



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Disabling Cut and Copy

Hi Jim

Key Board Ctrl+c OK
Key Board Ctrl+x OK

Edit Menu Copy ---- remained
Edit Menu Cut ---- remained

Standard Tool Bar "two page" for copy--- remained
Standard Tool Bar "Scissors" for cut ---remained

Please Answer.

Kind Regards
M Varnendra

"Jim Rech" wrote:

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
|
|
|



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 51
Default Disabling Cut and Copy

To remove cut is ID number 21

To remove copy is ID number 19

Not sure why you refer to ID number 522 as this turns off options in the
tools menu.


"Varne" wrote:

Thanks Stephen

Icon problem solved. Thanks. OK.

However;

Using Jim's solution I was able to turn off keys x and c to stop "Ctrl + x"
and "Cntrl + c" without changing ID numbers 21 or 522. I just had to insert c
for x to prevent "Cntr + c".

After trying yours "cut" goes off the menu but I cannot guess how to take
off "copy" in the menu. The user can use it. Is there any way to stop it?
Perhaps by putting in another two lines with another ID? Could you please
inform?

Thanks.

M Varnendra

"Stephen C" wrote:

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





  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Disabling Cut and Copy

Yeah.

Solved.

Thanks Stephen.

Will it be possible for you to teach me VBA and VB 6 on a fee paying basis?.


Kind Regards

M Varnendra

"Stephen C" wrote:

To remove cut is ID number 21

To remove copy is ID number 19

Not sure why you refer to ID number 522 as this turns off options in the
tools menu.


"Varne" wrote:

Thanks Stephen

Icon problem solved. Thanks. OK.

However;

Using Jim's solution I was able to turn off keys x and c to stop "Ctrl + x"
and "Cntrl + c" without changing ID numbers 21 or 522. I just had to insert c
for x to prevent "Cntr + c".

After trying yours "cut" goes off the menu but I cannot guess how to take
off "copy" in the menu. The user can use it. Is there any way to stop it?
Perhaps by putting in another two lines with another ID? Could you please
inform?

Thanks.

M Varnendra

"Stephen C" wrote:

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



  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 51
Default Disabling Cut and Copy

Another way to turn of ctrl+c is

Application.OnKey "^c", ""

To turn on ctrl+c

Application.OnKey "^c"


Change the c for x for ctrl+x


"Varne" wrote:

Thanks Stephen

Icon problem solved. Thanks. OK.

However;

Using Jim's solution I was able to turn off keys x and c to stop "Ctrl + x"
and "Cntrl + c" without changing ID numbers 21 or 522. I just had to insert c
for x to prevent "Cntr + c".

After trying yours "cut" goes off the menu but I cannot guess how to take
off "copy" in the menu. The user can use it. Is there any way to stop it?
Perhaps by putting in another two lines with another ID? Could you please
inform?

Thanks.

M Varnendra

"Stephen C" wrote:

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



  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Disabling Cut and Copy

Standard Tool Bar "Scissors" for cut ---remained

Not here. It is disabled for me with my code just as I posted it. ALL Cuts
are disabled regardless of the toolbar they appear on. I don't know why it
didn't work for you as long as you didn't modify the code. You should use
FindControls by the way because you cannot be sure you got them all
otherwise as users can add them manually to their toolbars.

Good luck.

--
Jim
"Varne" wrote in message
...
| Hi Jim
|
| Key Board Ctrl+c OK
| Key Board Ctrl+x OK
|
| Edit Menu Copy ---- remained
| Edit Menu Cut ---- remained
|
| Standard Tool Bar "two page" for copy--- remained
| Standard Tool Bar "Scissors" for cut ---remained
|
| Please Answer.
|
| Kind Regards
| M Varnendra
|
| "Jim Rech" wrote:
|
| 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
| |
| |
| |
|
|
|


  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Disabling Cut and Copy

Customize menu also has to be blocked.

Application.CommandBars.DisableCustomize=True

I can't help you with the other things.

--
Jim
"Varne" wrote in message
...
| Hi Jim
|
| You are right.
|
| But there is an other problem.
|
| I can turn cuts on through an other Excel Workbook Codes.
|
| Therefore I coded so that my book would only remain open only if it is the
| only book open.
|
| However this will restrict me in opening the book through an other book to
| stop the user disabling macros.
|
| Do you have an alternate solution to stop users opening an other workbook
| after opening my workbook?
|
| Also I encountered an other problem in disabling options.
|
| I am able to insert a second options command through customize menu.
| Customize menu also has to be blocked.
|
| Also please tell me what DD (in your first reply).
|
| Thanks and Regards
| M Varnendra
|
|
|
| "Jim Rech" wrote:
|
| Standard Tool Bar "Scissors" for cut ---remained
|
| Not here. It is disabled for me with my code just as I posted it. ALL
Cuts
| are disabled regardless of the toolbar they appear on. I don't know why
it
| didn't work for you as long as you didn't modify the code. You should
use
| FindControls by the way because you cannot be sure you got them all
| otherwise as users can add them manually to their toolbars.
|
| Good luck.
|
| --
| Jim
| "Varne" wrote in message
| ...
| | Hi Jim
| |
| | Key Board Ctrl+c OK
| | Key Board Ctrl+x OK
| |
| | Edit Menu Copy ---- remained
| | Edit Menu Cut ---- remained
| |
| | Standard Tool Bar "two page" for copy--- remained
| | Standard Tool Bar "Scissors" for cut ---remained
| |
| | Please Answer.
| |
| | Kind Regards
| | M Varnendra
| |
| | "Jim Rech" wrote:
| |
| | 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling formula Mel D Excel Discussion (Misc queries) 2 May 25th 08 10:54 PM
Disabling the cut function? Tim G. Excel Discussion (Misc queries) 3 September 27th 06 05:01 PM
Disabling updatelinks Dave Excel Discussion (Misc queries) 0 April 27th 06 12:05 PM
disabling the copy paste function in a cell sam Excel Worksheet Functions 0 February 22nd 06 02:10 PM
disabling CUT function Keef Excel Discussion (Misc queries) 2 January 23rd 05 12:17 AM


All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"