+ Reply to Thread
Results 1 to 9 of 9

Logging into a website using VBA

  1. #1
    Registered User
    Join Date
    09-27-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    14

    Unhappy Logging into a website using VBA

    Hi All,

    I am trying to login to a website using the code below. All the code is doing is opening the webpage and gives an error on 'While .Busy Or .ReadyState <> 4: DoEvents: Wend'. The error is a Run-time error ' -2147467259(80004005)' - Method 'Busy' of object 'IWebBrowser 2' failed.


    Please Login or Register  to view this content.
    Can I get some help on this please to make it work.

    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by Fotis1991; 10-10-2013 at 09:16 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Logging into a website using VBA

    I normally just use
    Please Login or Register  to view this content.
    can you load that webpage in your browser? Gives a timeout error for me.

  3. #3
    Registered User
    Join Date
    09-27-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Logging into a website using VBA

    well it may be because its a company's webpage but working fine with me. where shall I put the above code please?

  4. #4
    Registered User
    Join Date
    09-27-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Logging into a website using VBA

    I tried it but came up with a compile error on ' do events'

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Logging into a website using VBA

    Replace your while statement with it. Do you get error for the first or the second readystate line in your code?

  6. #6
    Registered User
    Join Date
    09-27-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Logging into a website using VBA

    It is the first ready state please

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Logging into a website using VBA

    Does this work?
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-27-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Logging into a website using VBA

    It does open the webpage but still with a run time error ' Object does not support this property' and it is for ' Do Until . readstate = 4'. and the form does not get filled in automatically. here is the HTML code from the website to give you an idea on tags.

    <html>
    <head>
    <title>Zen Internet's Administration Server</title>
    <link rel="stylesheet" href="/turing.css" type="text/css">
    <style type="text/css">
    <!--
    table.user {
    background-color: #c0f0c0;
    color: #000000;
    margin: 1px;
    padding: 0px;
    border-collapse: collapse;
    border-spacing: 0px;
    border-width: 1px;
    border-style: solid;
    border-color: #000000;
    }
    -->
    </style>

    </head>
    <body bgcolor="#ffffff">
    <center>
    <form method="post" action="/Tools/usageviewer.php">
    <table class="user">
    <caption>Please Log In</caption>
    <tr>
    <th>Username:</th>
    <td class="grey-l"><input type=text size=32 maxsize=32 name="user" value=""></td>
    </tr>
    <tr>
    <th>Password:</th>
    <td class="grey-bl"><input type=password size=32 maxsize=32 name="loginPassword" value=""></td>
    </tr>
    <tr>
    <th color="#c0f0c0" colspan=2>
    <input type=submit name="login" value="Login">
    <input type=reset name="reset" value="Reset Details">
    </td>
    </tr>
    </table>
    </form>
    <font color="red"><b></b></font>
    </center>
    </body>
    </html>

  9. #9
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Logging into a website using VBA

    Sorry, without the stupid mistakes this time (been a long day), does this work:
    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. Logging in to a website using Excel
    By FRIEL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2011, 11:08 AM
  2. Excel - Logging on to a website
    By jsomer2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2011, 12:55 PM
  3. Logging in a website with Macros
    By pink in forum Excel General
    Replies: 2
    Last Post: 12-14-2008, 07:24 PM
  4. Logging a website information.
    By Nneuromancer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-18-2006, 08:25 AM
  5. Logging into a website
    By Jackblack1 in forum Excel General
    Replies: 0
    Last Post: 05-31-2006, 12:27 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