ExcelActuary15
New Member
- Joined
- Sep 6, 2017
- Messages
- 1
Hi Everyone,
I'm trying to write a macro that will log me into a website (i.e. enter my username and password, then submit the webform). Everything runs perfectly until the macro tries to submit the form...at that point, it just refreshes the login page, rather than redirecting me to the "post-login" page. I'm confident that the username and password that the macro enters are correct, because I can manually press the submit button and it will log me in. This is the code, FYI:
I've also tried the following solutions, which haven't been successful:
.getelementbytagname("Input").Click
.all("Input").click
Any and all help would be appreciated. This is my first foray into html.
Thanks!
I'm trying to write a macro that will log me into a website (i.e. enter my username and password, then submit the webform). Everything runs perfectly until the macro tries to submit the form...at that point, it just refreshes the login page, rather than redirecting me to the "post-login" page. I'm confident that the username and password that the macro enters are correct, because I can manually press the submit button and it will log me in. This is the code, FYI:
Code:
Sub LogIn()
Dim ieApp As InternetExplorer
Dim ieDoc As HTMLDocument
'create a new instance of ie
Set ieApp = New InternetExplorer
ieApp.Visible = True
'assume were not logged in and just go directly to the login page
ieApp.Navigate "https://www.nfl.com/login"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
'fill in the login form
With ieDoc.forms(1)
.UserName.Value = "****************@gmail.com"
.Password.Value = "********"
.Submit
End With
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
End Sub
I've also tried the following solutions, which haven't been successful:
.getelementbytagname("Input").Click
.all("Input").click
Any and all help would be appreciated. This is my first foray into html.
Thanks!