How do I disable the right mouse cut and paste facility?

DexonII

New Member
Joined
Sep 8, 2005
Messages
34
I need to be able to prevent any user from cutting and pasting data in one of my spreadsheets. I have protected it all, removed cut and paste from the options- edit tab, but you can still cut and paste with the right mouse shortcut key.

How do I stop this from being available?

Paul.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
ShortcutMenus(xlWorksheetCell).MenuItems("Cut").Delete

and similarly with Paste.
 

DexonII

New Member
Joined
Sep 8, 2005
Messages
34
VoG II,

Thanks, will this remove it permantly from all further files that are opened? or does it just do it for the spreadsheet used?

Approx 45 different people will use these files (200 files) through one "master" switchboard. I would still like to be able to use the short cut menu on other spreadsheets.

Also where do I paste the statement? In the work book declerations?

Paul
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
No it isn't 'permanent'.

I would put it in an Auto_Open macro.
 

DexonII

New Member
Joined
Sep 8, 2005
Messages
34

ADVERTISEMENT

OK I will give it a go. Can the same be done for the shortcut keys ctrl+c ctrl+v ctrl+x etc?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

Code:
Application.OnKey "^{c}", ""        'Copy
Application.OnKey "^{v}", ""        'Paste
Application.OnKey "^{x}", ""        'Cut
 

DexonII

New Member
Joined
Sep 8, 2005
Messages
34

ADVERTISEMENT

Again placed in the same Open workbook sub?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Yes, I would create a sub called Auto_Open in an ordinary module and put all the disabling code in it.
 

DexonII

New Member
Joined
Sep 8, 2005
Messages
34
Hi VoG,

I'm backagain! I have tried the code to disable the short cut keys and that works just fine!

However when I try the code for the shortcut menu Cut, Copy, Paste and Paste Special I get an error with the macro.

It says "Run time error "1004" Application defined or object defined error"

How do I get round this to make it work??

Paul.
 

Forum statistics

Threads
1,141,626
Messages
5,707,486
Members
421,510
Latest member
haroonstr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top