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 create pull down menu box using vb script

0 Answers  


this q asked in applabs, q is: QTP should open google.com page and enter "qtp" in one edit(search) box and click search and should open google.com again and enter "job" in edit(search) box and click on search. I tried this but getting error "Edit(search) box matches more than one object", could anyone this question plz..

1 Answers   AppLabs,


What are the differences between sub procedures and function procedures?

0 Answers  


How to access array data?

0 Answers  


I have string like hp company.print tis like company hp.write a program in vbscripting

1 Answers   HP,






How will you check that a variable is an array in vbscript?

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,


Difference between Function and Sub routine?

0 Answers   Polaris,


compare the string without using stringcomp function?

1 Answers   CSS Corp,


give me any information abou vb script books learn quckly

0 Answers  


How can I write HTML text to the window in VB Script?

2 Answers  


Explain the adodb.stream class?

0 Answers  


Categories