I have an account with Morningstar.com and I wrote a vba script to automatically log me in. It worked great for the last year, however, it appears that they've updated the login page and I cannot figure out how to fix my code to automatically login again. The login web page is:
https://www.morningstar.com/members/login.html?vurl=http://www.morningstar.com
A snippet of my code looks like this:
I obviously replaced my username and password with X's. The problem is that the webpage is interactive in the fact that it won't even let you click the "sign in" button unless you've entered an appropriate username and password. The code above will enter my info into the username/password fields, but it's like the webpage doesn't realize their is data in the fields, and it won't let me execute the sign in button. However, if i deleted the last character of the username and password and re-enter them in with the keyboard, then it'll let me click the sign in button, or execute the ElementCol.Click vba code. Does anyone know what to do to make this work? Any help would be appreciated. Thanks
https://www.morningstar.com/members/login.html?vurl=http://www.morningstar.com
A snippet of my code looks like this:
Code:
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "https://members.morningstar.com/memberservice/login.aspx"
Do Until ie.ReadyState = 4
DoEvents
Loop
'Enter Username and Password in textboxes
Set UserN = ie.Document.getElementById("email-input-area")
If Not UserN Is Nothing Then
UserN.all(0).Value = XXXXXXXXX
End If
' password
Set PW = ie.Document.getElementById("password-input-area")
If Not PW Is Nothing Then
PW.all(0).Value = XXXXXXXX
End If
'Click the login button
'Old Method - M* updated their website
'Set ElementCol = ie.Document.getElementById("go_button")
'ElementCol.Click
'New Method
Set ElementCol = ie.Document.getElementsByTagName("input")(3)
ElementCol.Click
I obviously replaced my username and password with X's. The problem is that the webpage is interactive in the fact that it won't even let you click the "sign in" button unless you've entered an appropriate username and password. The code above will enter my info into the username/password fields, but it's like the webpage doesn't realize their is data in the fields, and it won't let me execute the sign in button. However, if i deleted the last character of the username and password and re-enter them in with the keyboard, then it'll let me click the sign in button, or execute the ElementCol.Click vba code. Does anyone know what to do to make this work? Any help would be appreciated. Thanks