+ Reply to Thread
Results 1 to 5 of 5

more keys on keybd_event

  1. #1
    Registered User
    Join Date
    03-16-2009
    Location
    italy
    MS-Off Ver
    Excel 2003
    Posts
    64

    more keys on keybd_event

    hi to all ,
    usually i use this to send key stroke (better than "send key" on my PC):
    Please Login or Register  to view this content.
    but bow i need to send :shift+ctrl+arrows left
    to select a text ,and i am not able to send more than one keystroke can someone help me
    many thanks , all the best
    Last edited by ilkamalo; 03-06-2010 at 05:06 AM. Reason: [SOLVED] Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: more keys on keybd_event

    Ciao ilkamalo,

    I added the code tags to your post to make it easier to read, copy and edit. Please do this in future posts.

    Copy this code into a separate VBA module.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    helsinki, finland
    MS-Off Ver
    Excel 2007
    Posts
    81

    Re: more keys on keybd_event

    Leith Ross!

    Nice, but incomplete set of special keys Shift, Ctrl,
    however, ALT is missing,
    of course it was not needed in ilkamalos case.

    I need to send ALT-F4 (=close) to Notepad
    and also need to know how to send Enter with keybd_event
    in case Save file? will pop up.

    Also do you know a web-page where all possible values for keybd_event would be?

    Thank you in advance.

    regards
    keymuu

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: more keys on keybd_event

    A better solution would be to look at why you are using send keys at all.

    You can write to a text document from Excel without using notepad

  5. #5
    Registered User
    Join Date
    11-01-2012
    Location
    helsinki, finland
    MS-Off Ver
    Excel 2007
    Posts
    81

    Re: more keys on keybd_event

    Kyle123!

    I'm not using SendKeys, I'm using keybd_event and I have a couple of questions about that.
    I try to close Notepad from Excel, or actually from VBA and would need to know how to press ALT
    and what is the ASCII value for F4

    regards
    keymuu

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1