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

Which command is used for writing text on a page?

0 Answers  


What are the properties of regexp object?

0 Answers  


Can automation testing find ssame no. of bugs what we can find by manual testing?

0 Answers  


Which data type/types are supported by vbscript language and what are their specialties?

0 Answers  


What is Procedure or Subroutine in VB Script?

0 Answers  






hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

0 Answers  


Mention what is vbscript?

0 Answers  


What is the purpose of regexp object in vbscript?

0 Answers  


Suppose by navigation I went from 1 st page to 5 page ,so Write a generic script for coming from any page to the 1st page and by executing where the page may be it will come to 1st page

1 Answers   CybAge,


Explain the adodb.stream class?

0 Answers  


Why is it recommended to close the database connection every time after the work is completed?

0 Answers  


How to Pass Multiple values in functions by using vb script? Function value(arg1,arg2) N1=arg1+arg2 N2=arg1-agr2 N3=arg1*agr2 N4=arg1/arg2 Value= How to pass ? End Function

3 Answers   iGate,


Categories