I have written some vba code to log into a secure website.
I have been successful in opening IE, inputting the Username and the Password. However, I can't get the login button to execute.
I inspected HTML button and the following HTML code is the corresponding code to the button:
<input tabindex="3" class="login-btn" id="btnLogin" type="button" value="Login">
I used:
With IE
.navigate Url
ieBusy ie
.Visible = True
Dim oLogin As Object, oPassword As Object
Set oLogin = .document.getElementsByName("txtUsername")(0)
Set oPassword = .document.getElementsByName("txtPassword")(0)
oLogin.Value = UserName
oPassword.Value = Password
.document.forms(0).submit <- Problem line code
end with
Can anyone help me solve this?
Thanks in advance.
I have been successful in opening IE, inputting the Username and the Password. However, I can't get the login button to execute.
I inspected HTML button and the following HTML code is the corresponding code to the button:
<input tabindex="3" class="login-btn" id="btnLogin" type="button" value="Login">
I used:
With IE
.navigate Url
ieBusy ie
.Visible = True
Dim oLogin As Object, oPassword As Object
Set oLogin = .document.getElementsByName("txtUsername")(0)
Set oPassword = .document.getElementsByName("txtPassword")(0)
oLogin.Value = UserName
oPassword.Value = Password
.document.forms(0).submit <- Problem line code
end with
Can anyone help me solve this?
Thanks in advance.