Im trying to create a VBA which access from excel to login into a certain site.
i try to multiple VBA formula but i am always getting error message which pointed out to the line i have bold below
The current error message i have received are
What is wrong to the command below?
Sub login()
Const Url$ = "Slync"
Dim UserName As String
Dim Password As String
Dim LoginData As Worksheet
Set LoginData = ThisWorkbook.Worksheets("Sheet1")
UserName = LoginData.Cells(1, 2).Value
Password = LoginData.Cells(2, 2).Value
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate Url
ieBusy ie
.Visible = True
Dim oLogin As Object
Dim oPassword As Object
Set oLogin = ie.document.getElementById("username")
Set oPassword = ie.document.getElementById("password")
oLogin.Value = UserName
oPassword.Value = Password
.document.forms(0).submit
End With
End Sub
Sub ieBusy(ie As Object)
Do While ie.Busy Or ie.readyState < 4
DoEvents
Loop
End Sub
i try to multiple VBA formula but i am always getting error message which pointed out to the line i have bold below
The current error message i have received are
"Runtime Error 424 'Object Required'"
What is wrong to the command below?
Sub login()
Const Url$ = "Slync"
Dim UserName As String
Dim Password As String
Dim LoginData As Worksheet
Set LoginData = ThisWorkbook.Worksheets("Sheet1")
UserName = LoginData.Cells(1, 2).Value
Password = LoginData.Cells(2, 2).Value
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate Url
ieBusy ie
.Visible = True
Dim oLogin As Object
Dim oPassword As Object
Set oLogin = ie.document.getElementById("username")
Set oPassword = ie.document.getElementById("password")
oLogin.Value = UserName
oPassword.Value = Password
.document.forms(0).submit
End With
End Sub
Sub ieBusy(ie As Object)
Do While ie.Busy Or ie.readyState < 4
DoEvents
Loop
End Sub