View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jan Karel Pieterse Jan Karel Pieterse is offline
external usenet poster
 
Posts: 535
Default application.onkey doesn't work

Hi Bob,

I made a commandbutton (activeX) with following code:

Private Sub CommandButton1_Click()
Application.OnKey "{F8}", "test"
End Sub

Sub test()
MsgBox ("ok")
End Sub

But after clicking on it and pressing F8, nothing happens.
Thanks for any advice.


Place the macro called "test" in a normal module.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com