i try to use the VBA code found from Login to a website using VBA
unfortunately i cannot access it as VBA is prompting some error message.
error VBA received Run time error '91' Object variable or With Block variable not set
Sub login()
Const Url$ = "https://kn.slync.app/login"
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 oLoging As Object
Dim oPassword As Object
Set oLogin = .document.getElementsByName("username")(0)
Set oPassword = .document.getElementsByName("password")(0)
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
Amendment made, Username and Password is populate as below screenshot enter image description here
This is the error message received on next Line .getElementsByClassName("ant-row-flex ant-row-flex-center ant-row-flex-middle")(0).Click
