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

What is the event handling in vbscript?

0 Answers  


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

3 Answers  


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

0 Answers  


write a vb script to calculate factorial of a number?

5 Answers  


How to get 120 using 5 zeroes, you can use any operator(+, *, /...) in qtp.

2 Answers   Cognizant,


What are the naming conventions while declaring a variable in the vbscript language?

0 Answers  


Explain about tristate constants?

0 Answers  


how to increase the values in text box in a given text box increament by two values by clicking on button

0 Answers  


What is the extension of the vbscript file?

0 Answers  


how to retrieve native property value in runtime?

1 Answers   Hexaware,


write a vb script to display the size of the folder,date created and name of the folder

1 Answers  


a function that takes an integer array as an argument and returns the largest value in the array. Use the function in a program

1 Answers  


Categories