08-29-2012, 04:56 PM
Please try below code
Code:
Set ObjExcel = CreateObject("Excel.Application")
ObjExcel.Visible = TRUE
Set oWorkbook = ObjExcel.Workbooks.Open "C:\Documents and Settings\mansi.shah\Desktop\book1.xlsx"
Set oWorksheet = oWorkbook.Worksheets("Sheet1")
rCnt = oWorkbook.Worksheets("Sheet1").UsedRange.Rows.Count
For i=2 to rCnt
URL = oWorkbook.Worksheets("Sheet1").Cells(i,1).Value
UserName = oWorkbook.Worksheets("Sheet1").Cells(i,2).Value
Password = oWorkbook.Worksheets("Sheet1").Cells(i,3).Value
System Util.run URL
Browser().Page().Webedit().Set UserName
Browser().Page().Webedit().Set Password
Browser("InSync :: Login").Page("InSync :: Login").WebButton("Login").Click
'Select facility'
Browser("InSync :: Login").Page("InSync :: Login_2").WebButton("Ok").Click
'Open Scheduler page'
Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$Image2").Click
Wait (3)
'Access Patient Search page'
Browser("InSync :: Login").Page("InSync :: Dash Board_2").Image("ctl00$Header1$Image3").Click
Browser("InSync :: Login").Page("InSync :: Patient Search").Image("Edit Patient").Click
Wait (3)
''Access Facesheet'
Browser("InSync :: Login").Page("InSync :: Patient Search").Image("ctl00$Header1$Image4").Click
Wait (3)
'Access New charge page'
Browser("InSync :: Login").Page("InSync :: Dash Board_2").Image("ctl00$Header1$Image5").Click
'Access Document Manager'
Browser("InSync :: Login").Page("InSync :: Dash Board_2").Image("ctl00$Header1$ibtndocumnetmgr").Click
Wait (3)
Browser("InSync :: Login").Close
Next