Create multiple records in the application using data from excel sheet rows
Hi, I'm using oleobject for calling excel file, I need some help on how to make my script run for multiple times if I have data in multiple rows in the excel sheet?
Please find the code below for calling the excel and reading the data from excel, assume i've 4 rows data in the excel which I want to use it for inputting into the applicatioin. The below function; I'm calling in my subroutine as shown below
Function ReadBudgetDetails()
Set Excel = Sys.OleObject("Excel.Application")
Call Excel.Workbooks.Open("E:\Budget.xlsx")
Delay 1000
For i = 1 to 4
s = ""
For j = 1 to 15
s = s + VarToString(Excel.Cells(i, j)) + "#"
Next
Next
ReadBudgetDetails = s
'Closes the driver
Call Excel.ActiveWorkbook.Save
Call Excel.Workbooks.Close
End Function
Above function is reading the excel file, but it is reading the last row and inputting the last row data into the application, code is below for reference. I want to create 3 records in the application as I have given data in 3 rows in the excel sheet. Could you please tell me what additional code I need to use below to create 3 records in the application using the data from excel sheet as shown in the above function?
Sub createbudget
'This is calling the above function
Dim str, arrStr
str = ReadBudgetDetails()
arrStr=Split(str,"#")
Set Rightframe = sys.process.page("http//").document.rightframe
RightFrame.document.all.Item("ddlProj").ClickItem(arrStr(1))
RightFrame.document.all.Item("ddlSubProj").ClickItem(arrStr(2))
End Sub