Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help
#1
Not Solved
Hi,

Can any one let me know whether it is possible to read content in excel sheet and copy the same cell by cell in an windows application by using QTP. If so please provide some script.

please let me know asap

Thanks in advance,

Regards,
Dinnu.
Reply
#2
Not Solved
Hi Dinu,

We can solve your issue by following the below steps.

1. Import the Excel to QTP using [Datatable.Import "File Path"]
2. Find the row count in excel using [Datatable.GetRowcount]
3. Use the for loop to fetch the data from the excel [For temp=1 to rowcount Step 1
Datatable.setcurrentrow(temp) 'to fetch the corresponding row record i.e temp
4. Pass the value to windows object.

Ex: You have a object WinEdit to insert data then follow as per the below code.

Code:
Datatable.Import "File Path"
intrcount=Datatable.GetRowcount
For temp=1 to intrccount-1 step 1
Datatable.SetcurrentRow(temp)
Window("xxxxxxxxxx").WinEdit(xxxxxxxxxxx").Set Datatable.Value("Parameter Id","Sheet ID")
Next
Note: Here "Parameter Id" means column name in excel
Sheet Id means from which sheet you are fetching the data.


Please let me know for further clarification.

Regards,
Venkat.Batchu.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)