+ Reply to Thread
Results 1 to 8 of 8

VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

  1. #1
    Registered User
    Join Date
    09-12-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Office 2013
    Posts
    6

    Unhappy VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    I am trying to get data from excel spreadsheet and past it into a form on internet explorer, and send it.

    To reset the form for each iteration I use aloop of ten Tab sends:

    Application.SendKeys “{Tab}”, True
    Application.Wait Now+TimeValue(“0:00:01”)
    DoEvents


    It’s not elegant and without the delay it gets out of sync.
    I’m not a VBA programmer.
    I’d like to be able to direct the cursor to the top Field on the webpage, not tab through the page

    Is there a way to set the cursor in IE to its first input field programmatically from excel ?

  2. #2
    Registered User
    Join Date
    09-12-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    I also posted this question on stackoverflow - got no replies, and searched Google for a simple method without success.
    'cant post the url'
    Surely this is a common use of the Application command set and Alt-Tab capability?

  3. #3
    Registered User
    Join Date
    09-12-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    I also posted this question on stackoverflow - got no replies, and searched Google for a simple method without success.
    'cant post the url'
    Surely this is a common use of the Application command set and Alt-Tab capability?

  4. #4
    Registered User
    Join Date
    09-12-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    I also posted this question on stackoverflow - got no replies, and searched Google for a simple method without success.
    'cant post the url'
    Surely this is a common use of the Application command set and Alt-Tab capability?

  5. #5
    Registered User
    Join Date
    09-12-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    Sorry admin, about the duplicated comments above. Delete?

  6. #6
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Re: VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    This may help - adjust to suit your needs. AppActivate will activate your Internet Explorer window (specify the title as needed), and click the mouse at the coordinates you specify, relative to the top left corner of your window.It may take a bit of experimenting to get it where you want it.

    Just be careful! If you send a mouse click to the wrong place, it's pretty much the same thing as letting your cat, baby, or worst enemy loose on your computer! I've added a 'NoClick' Boolean to avoid the mouse being clicked until you have determined the mouse is getting sent to the right spot. Once you've done that, set NoClick := False.

    Please Login or Register  to view this content.
    Last edited by mgs73; 09-12-2019 at 09:24 PM.

  7. #7
    Registered User
    Join Date
    09-12-2019
    Location
    Christchurch, New Zealand
    MS-Off Ver
    Office 2013
    Posts
    6

    Re: VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    many thanks mgs73
    That's fantastic - I just did a weeks work in an hour !!

  8. #8
    Registered User
    Join Date
    03-25-2021
    Location
    USA
    MS-Off Ver
    2016
    Posts
    8

    Re: VBA Excel Macro Application.SendKeys and directing the cursor to an input field in IE

    Thanks Experts!

+ 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] Application.SendKeys F1
    By brentjohn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2018, 12:18 PM
  2. SetFocus not re-directing cursor to propr textbox
    By Damian37 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2014, 09:50 AM
  3. Application.sendkeys - strange result! - Excel 2010
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2014, 07:36 AM
  4. Application.Sendkeys for Mac Excel
    By nalgene5622 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2012, 09:42 PM
  5. [SOLVED] Macro to manually input which field (column) to autofilter on using an input prompt
    By rin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2012, 09:35 AM
  6. how I can have the cursor return to the input field
    By barrington in forum Excel General
    Replies: 3
    Last Post: 03-01-2007, 11:59 PM
  7. Moving cursor to select input field in forms
    By ChucklesAS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2007, 03:18 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