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

How to return a value from function...? you should not tell msgbox, print.. etc.,

6 Answers  


write a vb script to display calculator using case statement?

1 Answers  


write a vb script to open a text file and write into it

2 Answers  


please can you help me to get a code of flames using a visual basic 6

0 Answers  


Explain about the support of asp for vb script functionality?

0 Answers  






sunday is sunday monday tuesday wendesday sunday thursday friday saturday sunday sunday how to count no of sunday in the text file from vb? Answer me asap

4 Answers  


How to check the particular window is exist or not with out using check points

2 Answers  


What are class variables?

0 Answers  


How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b) and i am addding those 2 and storing in to another var (c). Now i want to pass that var(c) to another function (fun2). What will be the script?

6 Answers   Nous,


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?

3 Answers   Logica CMG, McGraw Hill,


filter the array values without using filter function?

0 Answers   CSS Corp, WQED,


How to Enter Values on the Command promt using VB script

0 Answers  


Categories