Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 1
Default application.onkey doesn't work

Hi,

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.
bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default application.onkey doesn't work

Hi bob,

bob wrote:
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.
bob


write the Sub procedure in a standard module not in the Class module of the sheet.

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

  #3   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
application.run doesn't work grantj Excel Discussion (Misc queries) 3 June 2nd 06 08:07 PM
Excel sort application should work with Project WBS Ribas Excel Worksheet Functions 1 February 10th 06 04:10 PM
Application.OnKey problem Phillip Reeves[_2_] Excel Programming 1 January 23rd 04 06:46 PM
Ctrl-v doesn't work after changing Application.DisplayFormulaBar Lee Drage Excel Programming 1 January 7th 04 02:47 AM
capture users Application.OnKey RB Smissaert Excel Programming 1 September 8th 03 02:49 PM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"