vba login website

The solution for “vba login website” can be found here. The following code will assist you in solving the problem.

Sub login()

Const Url$ = “https://www.mast-technicalservices.com/ecp/index2.jsp”

Dim UserName As String, Password As String, LoginData As Worksheet
Set LoginData = ThisWorkbook.Worksheets(“Sheet1”)
UserName = LoginData.Cells(1, “B”).Value
Password = LoginData.Cells(2, “B”).Value

Dim ie As Object
Set ie = CreateObject(“InternetExplorer.Application”)

With ie

.navigate Url
ieBusy ie
.Visible = True

Dim oLogin As Object, oPassword As Object
Set oLogin = .document.getElementsByName(“ecp_param_userId”)(0)
Set oPassword = .document.getElementsByName(“ecp_param_password”)(0)

oLogin.Value = UserName
oPassword.Value = Password

End With

End Sub

Sub ieBusy(ie As Object)
Do While ie.Busy Or ie.readyState < 4 DoEvents Loop End Sub

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts