Pon lo siguiente en un módulo
Option Explicit
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Const WH_KEYBOARD_LL = &HD
Private Const WM_KEYDOWN = &H100
Private Const WM_SYSKEYDOWN = &H104
Private Const HC_ACTION = 0
Private Const VK_PRINTSCREEN = &H2C
Public Type KBDLLHOOKSTRUCT
vkCode As Long
scanCode As Long
flags As Long
time As Long
dwExtraInfo As Long
End Type
Private hHook As Long
Public Function SetKeyboardHook() As Long
If hHook = 0 Then
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, Application.Hinstance, 0)
SetKeyboardHook = hHook
End If
End Function
Public Sub UnsetKeyboardHook()
Call UnhookWindowsHookEx(hHook)
hHook = 0
End Sub
Private Function LowLevelKeyboardProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim lpllkHookStruct As KBDLLHOOKSTRUCT
If nCode = HC_ACTION Then
Call CopyMemory(lpllkHookStruct, ByVal lParam, Len(lpllkHookStruct))
If lpllkHookStruct.vkCode = VK_PRINTSCREEN Then
LowLevelKeyboardProc = True
Else
LowLevelKeyboardProc = CallNextHookEx(hHook, nCode, wParam, lParam)
End If
Else
LowLevelKeyboardProc = CallNextHookEx(hHook, nCode, wParam, lParam)
End If
End Function
Ejecuta esta macro SetKeyboardHook para desactivar la tecla printscreen
Ejecuta esta macro UnsetKeyboardHook para Activar la tecla
Referencia: http://www.excelforum.com/excel-programming-vba-macros/712168-application-onkey-problems.html
Puedes poner esto en el los eventos de tu libro, así cuando abras el libro se desactiva, y cuando cierras el libro se activa nuevamente:
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
UnsetKeyboardHook
End Sub
Private Sub Workbook_Open()
SetKeyboardHook
End Sub
Saludos.Dante Amor