Hi guys,
Im trying to figure out how to have excel login to a particular website via VBA. Currently the code I have works for other websites but this particular site has username/password field types as 'hidden' which I believe is the issue. Here is some of the code I currently have that is working:
Sub Login ()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim ieTable As Object
Dim clip As DataObject
Set ieApp = New InternetExplorer
ieApp.Visible = True
ieApp.Navigate "ANY WEBSITE URL"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
With ieDoc.forms(1)
.UserName.Value = "12345"
.Password.Value = "ABCD"
.submit
End With
ieApp.Quit
Set ieApp = Nothing
End Sub
Wont let me post the website inspect element that I am having issues getting the code to work with...
I have tried changing the username.value and password.value to something like this but still doesn't work:
ieApp.Document.getElementById ("input type='text' name='usernameDisplay value=' ' ")
Application.SendKeys "12345"
ieApp.Document.getElementById("input type='password' name='password'").Click
Application.SendKeys "ABCD"
ieApp.Document.getElementById("view:_id10").Click
Any help would be appreciated. Thanks.
Bookmarks