When importing an excel file that has several columns each
with different number of rows into QTP's Global datatable,
how can you count the number of rows in a particular column?

Answer Posted / satya

Here is a piece of code where we are importing the exl
sheet DS and getting row count then using them in For Loop.


datatable.AddSheet ("DS")
Datatable.ImportSheet "C:\satya.xls","DS","DS"
RowCount = Datatable.GetSheet("DS").GetRowCount
For RowCount = 0 to RowCount -1
Datatable.GetSheet("DS").SetCurrentrow(RowCount +1)
val = Datatable.RawValue("username","DS")
msgbox val
Next

hope it clear u...!

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.

4751


write a program to display configuration of a local system with the help of vb script.

1693


What are the properties of regexp object?

581


How are comments handled in the vbscript language?

513


What is the extension of the vbscript file?

553






What are the special sub-types in vbscript?

554


how to comvert 120 into one hunderd twenty rupees only and vice varsa

1807


Which operator is used to concatenate the 2 values in the vbscript language?

562


How to take whole text output from screen of Bitmap Application.

1873


What are the 2 ways to pass a value to the function?

518


Mention what if you do not specify anything when you call a procedure?

574


For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com

1758


Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..

2026


Explain the support of asp for vb script functionality?

637


Mention when to use function procedures and what are its characteristics?

629