Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Autologin macro not working perfectly

$
0
0

Hello Excel Experts.

I am pretty new to macros in Excel, but I have managed to make the following macro:

Private Sub Workbook_Open()

Dim i, LastRow, usr, pw

LastRow = Range("A" & Rows.Count).End(xlUp).Row
    For i = 1 To LastRow
        If Cells(i, "A").Hyperlinks.Count > 0 Then
        Cells(i, "A").Hyperlinks(1).Follow
        usr = ActiveSheet.Cells(i, 2).Value
        pw = ActiveSheet.Cells(i, 3).Value
        AppActivate "Internet Explorer", True
        Application.Wait 1000
        SendKeys usr, True
        Application.Wait 1000
        SendKeys "{TAB}", True

        SendKeys pw, True

        Application.Wait 1000

        SendKeys "~", True

    End If
Next
End Sub

As you might see this is supposed to open several websites an fill the login credentials for me.

I will try and explain it as best as I can ( Pardon my English, not my native language)

This is working partially on a website with a "normal" login field ( When you see the login-boxes on the site) , however it will first open the website, and then I have to click outsite the browser to let the macro fill out the form and log me in. 

If I click one time inside the browser before outside, nothing happens, but when i click outside the browser, it fills my PW in the USR field and starts a bing search for my PW.

Is there any way to make it run without having to click outside the browser?

And as a more complex question:

There are some sites using Windows-safety as a login method ( a pop-up appears and the credentials has to be entered here before proceeding to the site), this macro will not enter anything here. 

Is there any way to make the macro paste the credentials here?

Thanks in advance for any replies.

Best regards

Vetle



Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>