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

Hi Friends, Can anyone help me out in this one? In QTP, I am using Data Driver and want to parameterise multiple values (say 3 values ) for a field. How can I do it using Data Driver wizard? Plz mention it step-by-step. In the end after doing the needful, on opening the Data Driver window, how can I get number (i.e. 3) in the Parameterised column for that particualr value? Thanks a lot in advance.

1445


Name the properties you would use for identifying a browser and page when using descriptive programming?

524


write script for bitmap image?

1540


how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??

1588


In qtp, explain what is crypt object

598






When do go for loop condition in test?

654


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

1467


Explain in brief about the quicktest professional (qtp) automation object model?

569


What are the views available in quicktest professional?

563


How you debug your script?

569


what are the critical test cases in crm? tell me atleast 5 critical test cases? what are the critical bug u find out while testing crm domain?

2740


Explain quicktest professional testing process?

564


What are the advantages of parameterization ?

598


How to run a test using quicktest professional (qtp)?

544


What is different command used in command Prompt while using QTP?

1747