Import value1 values from
sample1.xls file, import value2 values
from sample2.xls file, add value1 and value2 values and display in result colum
and export final output result file.
datatable.ImportSheet
"D:\VJProjects\QTP Demo\sample1.xls",1,1
datatable.ImportSheet
"D:\VJProjects\QTP Demo\sample2.xls",1,2
datatable.AddSheet("result")
datatable.ImportSheet
"D:\VJProjects\QTP Demo\sample3.xls",1,3
For
rowNum=1 to datatable.GetRowCount
val1=datatable("first",1)
val2=datatable("second",2)
datatable.GetSheet(3).GetParameter("first").valueByRow(rowNum)=val1
datatable.GetSheet(3).GetParameter("second").valueByRow(rowNum)=val2
val3=cint(val1)+cint(val2)
datatable.GetSheet(3).GetParameter("result").valueByRow(rowNum)=val3
datatable.SetNextRow
Next
Contributed by: Vamshi Gowtham
m.vamsigowtham@gmail.com
Contributed by: Vamshi Gowtham
m.vamsigowtham@gmail.com