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
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 |
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 |
Answer / srinu
setShet = Datatable.Getsheet("Sheet Name")
rowcon=shet.getparameter("colum Name").getrowcount
msgbox rowcon
| Is This Answer Correct ? | 3 Yes | 5 No |
What are the 2 ways in which a variable can be declared in the vbscript language?
write a vb script to display the reverse of vbs
write a program to display the system specifications of client system with the help of vbScript.
How can you destroy an object in vbscript?
What is parametrization ?
What is select case statement?
how to retrive the tooltip by using descriptive programming in qtp?
Can anybody code this problem for me in VB script - Create an array of 4 elements, increase its size to 7 elements and then find out which of the elements are prime (use functions)
Which is the default Data types in VBScript?
Which function allows you to instantiate an object given its programmatic identifier or progid?
How to create pull down menu box using vb script
how to write vb script code for login gmail page by using notepad and how to run script in notepad