Hi all,
I am relatively new to VBA but I'm enjoying figuring out new things in it.
Right now I am trying to create a button in Excel that will automatically go to my university's log-in page and fill in my credentials. I already got a button like this working for my Gmail account. However, for my university login it does not seem to work. I have the following lines of code:
The whole first part (opening the website) works fine. The bottleneck right now are the last three lines. I used the same lines for my Gmail login button (though there instead of ''Erna_ID'' I used "email address"). Basically what I cannot get to work is the code to recognize the correct text boxes called ERNA ID for username and Password for Password. Is there anyone who has got any tips on solving this for both this specific website (www.myeur.nl) and for any website in general? I would really like to learn how to do this for other websites (e.g. Facebook or LinkedIn) too.Sub UniversityLogin()
Dim IE As Object
Dim MyUsername As String, MyPassword As String
MyUsername = "MyUsername"
MyPassword = "MyPassword"
Set IE = CreateObject("INTERNETEXPLORER.Application")
IE.Navigate ("www.myeur.nl")
IE.Visible = True
Do While IE.Busy: DoEvents: Loop
Application.Wait (Now + TimeValue("00:00:02"))
IE.Document.all.Item("Erna_ID").Value = MyUsername
IE.Document.all.Item("Password").Value = MyPassword
IE.Document.all.Item("loginbutton").Click
End Sub
Bookmarks