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

What is Procedure or Subroutine in VB Script?

703


How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.

1833


How to assign a numeric value to a variable?

726


how to set one column as primary key in QTP and fetch values accordingly

1919


Explain about the functionality of vb script?

664






How to create a cookie using vbscript?

683


How can you create a file object to work with the files in the vbscript language?

593


Write a code to print numbers from 5 to 0?

790


Explain the scope of the variables using dim, public, and private keywords respectively.

805


how does vb script help in web page designing? explain with example.

1672


How many types of procedures are available in the vbscript language?

613


Mention how to create a cookie using vbscript?

613


Hi this is Vinoth. I need a help on below mentioned question A combobox contains list of items assume as 5 I have to get each items Individually and I have to Export to datatable. Please help me on this. Thanks

1813


Which event is triggered when mouse focus comes out of an element in the vbscript language?

593


how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me

13206