+ Reply to Thread
Results 1 to 6 of 6

Automating IE with VBA Macro

  1. #1
    Registered User
    Join Date
    10-11-2016
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    4

    Automating IE with VBA Macro

    Hi everyone,

    I'm kind of a noob when it comes to VBA, although I have been experimenting with it for a while.

    What I'm trying to do is automate a login, some button clicks and then fill in a form on the webpage.

    Now, I managed to get the macro to login. However, after that, it needs to click a button, which won't work. Or actually, it does work, but only when I F8 through my code. When I run it all at once it gives me a 'runtime error 424, object required' .

    At first I thought this was because the element was not loaded on the page yet (the page load takes a while) so I added:

    Please Login or Register  to view this content.
    This didn't work, so I added a fixed wait:

    Please Login or Register  to view this content.
    Didn't work either.

    Anyone some ideas on how to fix this? Again, it does work when I 'F8' the code.

    Please find below full code:

    Please Login or Register  to view this content.
    Unfortunately, I can't send html because it's a work related login page.

    Any ideas would be much appreciated!

    Best,

    J.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Automating IE with VBA Macro

    Do While IE.readystate <> 4: DoEvents: Loop

    So, there are two steps in to to log-in?
    Does the button have a "Name or ID"?

  3. #3
    Registered User
    Join Date
    10-11-2016
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    4

    Re: Automating IE with VBA Macro

    The login is fine. I can use the VBA to login. It bugs at this line:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Automating IE with VBA Macro

    If you log-in why do you need to click then? Is it to go in to next page?

    pt1:r1:0:r1:0:r1:0:g11

    Is it a valid ID? How and where do you get it?

  5. #5
    Registered User
    Join Date
    10-11-2016
    Location
    Amsterdam
    MS-Off Ver
    2013
    Posts
    4

    Re: Automating IE with VBA Macro

    Thanks for your reply again.

    It's just a button click on the page after the login. I can put in user id/pass and click the login.

    Yes, it's valid. I got it from the html of the webpage and it's working when I F8 through the code.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Automating IE with VBA Macro

    If it is working through F8 it is because of time lag.
    Does the log-in have a name or ID?

    Please Login or Register  to view this content.

+ 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. automating macro when cell value changes
    By hiswillbedun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2015, 08:12 AM
  2. Automating Macro's
    By Deenz_13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2013, 05:19 AM
  3. automating a macro
    By kornnut in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-11-2010, 02:03 AM
  4. Automating a macro to repeat itself
    By Sargasso in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2007, 06:21 AM
  5. Automating a macro
    By Marcus Gee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2007, 06:43 PM
  6. automating a macro to increment row
    By Plusone in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-16-2007, 08:11 AM
  7. automating macro
    By chris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2005, 01:06 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