Hi I am having issues with a macro that I am hoping to use to login into a website (https://www.kewilltransport.net/tms/servlet/Login).
I have been able to successfully execute this code on other websites that I use, but keep getting the following error message when I get to line 6 (where it tries to find the logon tbox using GetElement)," Run-time error '13': Type mismatch "
From what I've read online I think it has something to do with the website using frames, instead divs (I'm a noob so apologies if I'm way off)
Here's the code I'm using:
Thanks!
I have been able to successfully execute this code on other websites that I use, but keep getting the following error message when I get to line 6 (where it tries to find the logon tbox using GetElement)," Run-time error '13': Type mismatch "
From what I've read online I think it has something to do with the website using frames, instead divs (I'm a noob so apologies if I'm way off)
Here's the code I'm using:
Code:
Sub LogonScript()
Const READYSTATE_COMPLETE = 4
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = 1
IE.navigate "https://kewilltransport.net/tms/servlet/Login"
Application.Wait (Now + TimeValue("0:00:02"))
Set Login = IE.document.getElementByID("f_username") 'username textbox
Login.Value = "USERNAME" 'where I enter by username
Set Password = IE.document.getElementByID("f_password") 'password textbox
Password.Value = "PASSWORD" ' Where I enter my password
Set LogOn = IE.document.getElementByID("f_btn2") 'login button name
LogOn.Click
End Sub
Thanks!