Read excel using qtp descriptive programing

Answer Posted / bindu

'Create Excel Object
Set excel=createobject("excel.application")
'Make it Visible
excel.Visible=True
'Open the Excel File
Set workbook=excel.Workbooks.Open("D:\excel.xls")
'Get the Control on Specific Sheet
Set worksheet1=workbook.Worksheets.Item("Sheet1")
'get rows count
a1=worksheet1.usedrange.rows.count
'get columns count
a2=worksheet1.usedrange.columns.count
msgbox a1
msgbox a2
For i=1 to a1
celltext=" "
For j=1 to a2
celltext=worksheet1.cells(i,j)
msgbox celltext
Next
Next
workbook1.close
set excel=nothing

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the frame work in J-meter?

1701


in qtp if we record a object and we record the object using virtual wizard then by which way the object is recognized that means recorded

1610


in qtp 3 sheets is there in data table like global, action1, action2. I want to check the rows and columns in action2. how can check using script?

6485


To retrive the test data which tool vl use and whats basis u vl write test data? its urgent

1528


How will you report the bug and explain the defect tracking sheet you handled?

2647






How is a Step generator used in UFT?

756


How to write business scripts using object repository with different scenarios

1473


Where we can use the analog mode and where we can use the low – level mode?

655


what QTP Options do you know?

3018


How to handle the exceptions using the recovery scenario manager in qtp?

644


How do you synchronization point through DP?

705


Is there any pdf or online book for QTP Scripting? Let me know more about QTP Scripting.

2501


suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?

1404


How you can delete excel file in qtp?

670


What is the descriptive programming?

1614