Sub test()
' open IE, navigate to the desired page and loop until fully loaded
Set IE = CreateObject("InternetExplorer.Application")
my_url = "http://rd.hemaspharma.com/Pharma/Login.aspx?ReturnUrl=%2fPharma"
With IE
.Visible = True
.navigate my_url
.Top = 5
.Left = 5
.Height = 600
.Width = 900
Do Until Not IE.Busy And IE.readyState = 4
DoEvents
Loop
End With
' Input the userid
IE.document.getElementById("ASPxRoundPanel1_ctl12_txtUserName").Value = "TestName"
IE.document.getElementById("ASPxRoundPanel1_ctl12_txtPassword").Value = "TestPW"
' Click the "Next" button
IE.document.getElementById("ASPxRoundPanel1_ctl12_btnLogin").Click
Do Until Not IE.Busy And IE.readyState = 4
DoEvents
Loop
End Sub