+ Reply to Thread
Results 1 to 10 of 10

Need Help With SendKeys

  1. #1
    Registered User
    Join Date
    08-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    26

    Angry Need Help With SendKeys

    Hello all,

    I am trying to perform a SendKey function that will paste the contents of my clipboard into a cmd window.

    I know for sure that the following keystrokes will accomplish this:
    Hold ALT then click SPACE
    Then "e"
    Then "p"

    The problem is I cannot figure out how to translate this combination of ALT and SPACE into a usable SendKey, and it's driving me nuts.

    The character string of:
    Please Login or Register  to view this content.
    successfully executes a spacebar stroke, but I cannot figure out how to combine it with ALT.

    I know that ALT is represented by "%"

    I have tried:

    Please Login or Register  to view this content.
    But I get a Compile error: Invalid character


    I also tried:

    Please Login or Register  to view this content.
    But I get a Expected:end of statement error


    Any help would be appreciated!!
    Thanks

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Need Help With SendKeys

    Everything goes inside the quote.
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    if you need to break it up.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Need Help With SendKeys

    Hi,

    I always do a "DoEvents" after a sendkeys so the other program has time to process the event and then come back to excel.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    08-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Need Help With SendKeys

    Awesome! Thanks for the input guys. I'll try this out tomorrow and let you know how it goes.

  5. #5
    Registered User
    Join Date
    08-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Need Help With SendKeys

    Unfortunately this did not work.

    The code provided by Tinbendr:
    Please Login or Register  to view this content.
    does not seem to HOLD the ALT button down. It only creates a space then writes "ep" in the telnet session.

    Do you guys have any other ideas?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need Help With SendKeys

    Do you hold Alt down while pressing all three keys? Is so, use "%( ep)"
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    08-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Need Help With SendKeys

    No, I only need to hold ALT, then press spacebar.

    This will open the menu within the telnet session and allow the shorcuts of "e" (edit) and 'P

  8. #8
    Registered User
    Join Date
    08-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Need Help With SendKeys

    No, I only need to hold ALT, then press spacebar.

    This will open the menu within the telnet session and allow the shorcuts of "e" (edit) and '"p" (paste)

  9. #9
    Registered User
    Join Date
    08-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Need Help With SendKeys

    I just found a solution to my problem.

    Trying to send the proper combination of keys in order to paste into a command window with "ALT+SPACE,e,p" proved impossible. So I did some research and came across a program called AutoHotKey, which I'm sure a lot of you have already heard of. By running a script that allows pasting into a cmd window using a standard CTRL+V combination, I was able to achieve the results I was looking for!

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need Help With SendKeys

    Glad you got it sorted, thanks for posting back.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sendkeys for Alt+8
    By plasma33 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2012, 06:09 PM
  2. SendKeys ??
    By lrhodes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2006, 03:41 PM
  3. [SOLVED] SendKeys Help
    By ajvasel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2006, 11:54 AM
  4. Always Sendkeys...
    By Angelo_R in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2006, 04:15 AM
  5. [SOLVED] SendKeys?
    By CMK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2005, 08:06 PM

Tags for this Thread

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