On my Excel spreadsheet: web address is in B, username in C, password in D, UN ID in E, PW ID in F, Button ID in G, land page (to go to after logged in) in H. Right click triggers below macro for that particular row. Succeeds in opening address in B, however not seeing log in credentials being put in and gives "Run-time error '5000': Application-defined or object-defined error" on following line:
Here's the code I have so far:
Code:
Set e = IE.document.getElementById(Range("G" & (ActiveCell.Row)))
Here's the code I have so far:
Code:
Sub PassMASTER()
Dim IE As InternetExplorer
Set IE = CreateObject("InternetExplorer.application")
IE.Visible = True
IE.navigate Range("B" & (ActiveCell.Row))
Do
If IE.readyState = 4 Then
IE.Visible = True
Exit Do
Else
End If
Loop
Application.Wait (Now + TimeValue("00:00:02"))
IE.document.getElementById = Range("E" & (ActiveCell.Row)).Value = Range("C" & (ActiveCell.Row)).Value 'put user name
Application.Wait (Now + TimeValue("00:00:02"))
IE.document.getElementById = Range("F" & (ActiveCell.Row)).Value = Range("D" & (ActiveCell.Row)).Value 'put password
Dim e As Object
Set e = IE.document.getElementById(Range("G" & (ActiveCell.Row)))
e.Click
Application.Wait (Now + TimeValue("00:00:01"))
IE.navigate Range("H" & (ActiveCell.Row))
End Sub