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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

when we use filter funtiom invb script(QTP)

2468


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

1980


How will you convert a given number to long in vbscript?

654


Description.Create

2354


How to capture a runtime error in vbscript?

825


What are keywords in the vbscript language?

718


Explain the operator precedence in vb script?

827


i have a problem with this error(this error related edit and delete button,when i click this button in datagrid..i will get this error)"Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation." this is my code : <%@ Page Language="VB" Debug="false" %> <%@ import Namespace="Sytem.Data" %> <%@ import Namespace="System.Data.OleDB" %>

(Search Based On Staff I.C No) IC.No (XXXXXX-XX-XXXX)   ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> ' runat="server"> Total Leave Taken : Days

2504


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

779


who will create the object?

1895


Is vbscript language a case-sensitive language and what does it mean?

745


Explain about the functionality of vb script?

751


How to Import data from a file (file is on the desktop) to the data table

1789


Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.

1594


How to get the length of the string by making use of the string function?

807