Private Sub CommandButton1_Click()
Dim ie, iedoc, submitbtn As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate Sheets("Sheet1").Cells(8, 5)
ie.Visible = True
Do While ie.Busy And Not ie.readyState = 4
DoEvents
Loop
DoEvents
ie.document.all.Item("user").Value = ThisWorkbook.Sheets("Sheet1").Range("A1")
ie.document.all.Item("password").Value = ThisWorkbook.Sheets("Sheet1").Range("A2")
Set iedoc = ie.document
Set submitbtn = ie.document.all.Item("btnLogin")
submitbtn.Click
Do While ie.Busy 'Or ie.readyState <> READYSTATE_COMPLETE
DoEvents
Loop
DoEvents
ie.SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True 'press enter
Bookmarks