Javascript automatic login using VBA

Alphakx

New Member
Joined
Dec 29, 2013
Messages
3
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!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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
 
Upvote 0
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!
 
Upvote 0
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?
 
Upvote 0
This line causes the error:
Code:
With .document.frames(0).document

Maybe I miss an extension/plugin?
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,186
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top