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

i need to sort the data using qtp script for this how i need to write a qtp script

0 Answers  


write a Vb script to find a whther a selected drive exits.

1 Answers   CTS,


To get data from table which method will be used in QTP

3 Answers  


Write a program to create a Dynamic array of size 5 elements and display all the elements.

1 Answers  


What is the difference between VBScript and JavaScript?

0 Answers  






What are keywords in the vbscript language?

0 Answers  


What are the differences between Visual Basic, VBA and VBScript? When would it be appropriate to use one as opposed to another?

1 Answers   Infosys,


What is the equivalent of VBScript?s On Error In Jscript ?

1 Answers   Microsoft,


i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me

0 Answers  


w r p syed then output was deys and click eysd and click ysde and click sdey and click deys and click eysd............

2 Answers   Cap Gemini, iGate,


write a vb script to display the reverse of vbs

2 Answers  


did any one attended interview in applabs if you had gone through plz tell me the procedure

0 Answers  


Categories