PDA

View Full Version : Application.onkey



ckolbas
04-21-2011, 08:25 PM
Hello Everyone!

I am trying to assign a keyboard shortcut to a macro.

I am trying to use application.onkey "%r", "analyzerResume"

This bit of code is in the workbook_open

The sub is in module 1.

Is there something that I am missing?

Thanks in advance for any help!
Christian

GTO
04-22-2011, 02:47 AM
I tried:

Private Sub Workbook_Open()
Application.OnKey "%r", "analyzerResume"
End Sub
...works just fine.

I would check to see where you have 'analyzerResume' housed. Is it in a Standard Module where it can be "seen"?

Just a suggestion, but generally, I would use Workbook_Activate and Workbook_Deactivate for addition/deletion of commandbars/shortcut keys... stuff you don't want the user accidently using in another open wb.

Hope that helps,

Mark