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?

Answers were Sorted based on User's Feedback



When importing an excel file that has several columns each with different number of rows into QTP&..

Answer / pushkar1206

datatable.ImportSheet "C:UserspushkarDesktop123.xls","Sheet1","Action1"
rw=datatable.GetSheet("Action1").GetRowCount
For i=1 to rw
a=datatable.GetSheet("Action1").GetParameter("_11").ValueByRow(i)
c=len(a)
If c>0 Then
b=b+1
End If
Next
msgbox b

Is This Answer Correct ?    1 Yes 0 No

When importing an excel file that has several columns each with different number of rows into QTP&..

Answer / 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

When importing an excel file that has several columns each with different number of rows into QTP&..

Answer / srinu

setShet = Datatable.Getsheet("Sheet Name")
rowcon=shet.getparameter("colum Name").getrowcount
msgbox rowcon

Is This Answer Correct ?    3 Yes 5 No

Post New Answer

More VB Script Interview Questions

What is the difference between vbscript and vba?

0 Answers  


which is the bset training centre to learn automation tools?

2 Answers  


what is resorceallocation

0 Answers  


what is the standards used for writing the script in QTP

0 Answers  


write a vb script to display ***** ***** ***** ***** *****

4 Answers  






How can I get the value of an object property or variable in another frame?

1 Answers   Citi Bank,


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

0 Answers  


How many data types are supported in Vbscript?

3 Answers   Microsoft,


Differentiate javascript and vbscript?

0 Answers  


What are lbound and ubound in the vbscript language?

0 Answers  


write a vb script to add two 2*2 matrix

2 Answers  


How to get the background color of a weblist?

3 Answers   Accenture,


Categories