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

How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?

767


How you can write contexts to text file in qtp?

787


When Recovery scenario actually starts while testing the application?

1756


Qtp has been installed on my pc but recently ON opening it is giving this error PLEASE REPLY IT IS URGENT IT WAS WORKKING FINE QTPRO.EX THE instruction at "0x7.. ...". referenced memory at "0000....The memory could not be read... Awaiting QTP XPERTS REPly URGENT

2274


How to indentify MS-Word objects like Menubar, Toolbar, table/columns/rows/cells etc within Word document, using QTP?

2054


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

1760


how do u manipulating INI, DLL and / or registry files in support of your test environment? actually what do u mean by INI and DLL or registry files. plzzz its urgent do answer

1657


Can we run test with out adding object in object repository? How it is possible?

799


What is difference between run time object and test object?

749


how to find that a file has been completely downloaded or not? I told that "download Complete" pop up. but he told the tool doesn't recognize the pop up

4077


Hi this is chandra if any one have Navigation of LAB QTP, I want Navigation of those tools, if any one have the and know the Navigation each and every part of the QTP, plz send me my mail naruboinac@yahoo. com,naruboinas@ gmail.com

1682


Discuss quicktest professional environment?

779


What is RTM (require ment tracebulity marix) fromate?

1712


What is the use of sendkeys and what are send keys

2183


can i compare two databases using QTP ?

2119