+ Reply to Thread
Results 1 to 3 of 3

SendKeys in Active Window

  1. #1
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2003
    Posts
    125

    SendKeys in Active Window

    Not specifically a problem, just trying to learn more VBA through trial and error. Theoretically, this code should open internet explorer, wait for some time, and then simulate the keyboard strokes Ctrl+E.

    Please Login or Register  to view this content.

    My question is, why does the search field not highlight in Internet Explorer when I run the macro and simulate Ctrl+E (search the web shortcut). I understand SendKeys is volatile and does not necessarily run at the same time as the application opens which is why I try to wait for 3 seconds to give IE enough time to open.

    Any tips? Cheers.
    B.Econ, CFA

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: SendKeys in Active Window

    I do not know what this key combination should do.
    But Sendkeys need to be preceeded by DoEvents to have the sub wait for keyboard input.
    Please Login or Register  to view this content.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: SendKeys in Active Window

    You should avoid using SendKeys if you can.

    What is it you are trying to do?

+ 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