View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default Diactivate shortcut keys

"Uddinj1" wrote in message
...
Is there a way to diactivate the keyboard shortcuts while a specific

workbbok
is open, so that if the user press e.g. Ctrl+C it would not work. Thanks.


You can use Application.OnKey to do this. Run the following line when
your workbook opens, either in the Auto_Open procedure or Workbook_Open
event:

Application.OnKey "^c", ""

This disables Ctrl+C copying. To enable it again when your workbook closes
add the following line to the Auto_Close procedure or Workbook_BeforeClose
event:

Application.OnKey "^c"

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *