Results 1 to 5 of 5

Javascript automatic login using VBA

This is a discussion on Javascript automatic login using VBA within the Excel Questions forums, part of the Question Forums category; ...

  1. #1
    New Member
    Join Date
    Dec 2013
    Posts
    3

    Default Javascript automatic login using VBA

    Hi,

    I'm trying to use VBA to login to this website: NetStore
    I started using this tutorial: Daily Dose of Excel Blog Archive Get Data from Website that Requires a Login
    but I wasn't able to fill in the username/pasword or to use VBA to click the submit button.
    I also tried to use this tutorial: How to Login into Website Automatically Using VBA - YouTube which worked great for gmail but not for the site that i want.
    So I think I will need some help from one of you guys... Can anybody give me some advice to get started?

    Thanks in advance!

  2. #2
    Board Regular
    Join Date
    Oct 2007
    Posts
    4,555

    Default Re: Javascript automatic login using VBA

    Nothing to do the JavaScript. That page uses frames so you need to access the frame document, like this:
    Code:
    Sub x()
    
        With CreateObject("InternetExplorer.Application")
            .Visible = True
            .navigate "http://www.rexel.be/NS600/servlet/be.rex.ns.cf.RexStartServlet?Language=NL&~CHARSET=UTF-8"
            While .busy Or .readystate <> 4: DoEvents: Wend
            With .document.frames(0).document
                .getElementsByName("User")(0).Value = "username"
                .getElementsByName("Password")(0).Value = "password"
                .getElementsByName("ACTION_SIGNON")(0).Click
            End With
        End With
        
    End Sub

  3. #3
    New Member
    Join Date
    Dec 2013
    Posts
    3

    Default Re: Javascript automatic login using VBA

    Thank you!
    Guess we're getting close, but I'm getting an error saying "Error -2147352319 (80020101), Automation error"
    Did I miss anything?

    Thanks alot!

  4. #4
    Board Regular
    Join Date
    Oct 2007
    Posts
    4,555

    Default Re: Javascript automatic login using VBA

    That code is all you should need. It works for me on IE8 and XP. Which line (highlighted in yellow when you run the code) causes the error?

  5. #5
    New Member
    Join Date
    Dec 2013
    Posts
    3

    Default Re: Javascript automatic login using VBA

    This line causes the error:
    Code:
    With .document.frames(0).document
    Maybe I miss an extension/plugin?

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com