+ Reply to Thread
Results 1 to 4 of 4

Problem with clicking links in IE

  1. #1
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Problem with clicking links in IE

    Hi all,

    I got a problem when navigate IE via vba. Below is my code, problem exists in the red words. After I input ticker and click "search" button, the IE jumps to another page, but when I wanna further click a link on the new page, the vba still "remembers" the old URL. How can I amend the code to let me have a chance to select links on the new page? Thank you so much.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Problem with clicking links in IE

    Hi,

    That's because after you fired button.Click, the IE engine is still fetching the new page, but you already forced to pull information, so you got the old page.
    You must wait IE engine until it is not busy and complete fetching the new page. So here the code :

    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Problem with clicking links in IE

    Thank you Karedog, but the code is sometimes success ( I ran the code 10 times, but just 2 times I can load the page after the search button).
    Quote Originally Posted by karedog View Post
    Hi,

    That's because after you fired button.Click, the IE engine is still fetching the new page, but you already forced to pull information, so you got the old page.
    You must wait IE engine until it is not busy and complete fetching the new page. So here the code :

    Please Login or Register  to view this content.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Problem with clicking links in IE

    That's strange, get 100% success rate here (I am using IE8 on my computer).
    You can try to tell Excel gives more time by using Application.Wait() function.
    In this sample, I tell Excel to give more two seconds at this line: Application.Wait (Now + TimeValue("0:00:02"))
    You can try to change the value until you got 100% success rate.

    Please Login or Register  to view this content.
    Last edited by karedog; 10-05-2014 at 04:47 AM.

+ 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. Replies: 3
    Last Post: 04-14-2014, 09:01 AM
  2. Clicking email links to send specific cell information
    By Dessesbo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-24-2013, 10:36 AM
  3. macro automatically clicking links in cells
    By akxander in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-30-2009, 02:13 PM
  4. Problem clicking in cells
    By bosstone75 in forum Excel General
    Replies: 2
    Last Post: 05-13-2007, 09:41 PM

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