QTP Script to create Excel Sheet and to enter data into it

QTP Script to create Excel Sheet and to enter data into it(using script).

To create Excel Sheet

Set Excel=createObject("Excel.Application")
Set ExcelSheet=createObject("Excel.sheet")
ExcelSheet.Application.visible=true

'script to enter data(into excel sheet)
Excel.ActiveSheet.cells(1,1).value=1111
Excel.ActiveSheet.cells(1,2).value=2222
Excel.ActiveSheet.cells(2,1).value=3333
Excel.ActiveSheet.cells(2,2).value=4444

ExcelSheet.SaveAs "C:/XYZ.xls"

Excel Sheet is saved in C folder with following data.

A B
1111 2222
3333 4444

Data Driven Testing using Excel Sheet

3 comments:

Anonymous said...

really helpful

Anonymous said...

thanks a lot for ur help

Anonymous said...

really it was very helpful. thanks

Related Posts Plugin for WordPress, Blogger...