The xls contain data. how to get number of columns form
the sheet?
Answer Posted / uday
strFilePath="D:\EmpDetails.xls"
Dim fileSysObj
Set xlObj=createobject("Excel.application")
Set xlWorkBookObj=xlObj.workbooks.open(strFilePath)
Set xlWorkSheetObj=xlWorkBookObj.worksheets(1)
intRowCount=xlWorkSheetObj.UsedRange.rows.count 'intRowCount
=xlWorkSheetObj.rows.count - it returns the number of rown
in an Excel sheet
intColCount=xlWorkSheetObj.UsedRange.columns.count
' intColCount=xlWorkSheetObj.columns.count - it returns the
number of columns in an Excel sheet
msgbox "No. of rows used "&intRowCount&" and No. of columns
used. "&intColCount
xlWorkBookObj.close
xlObj.application.quit
Set xlObj=nothing
Set xlWorkBookObj=nothing
Set xlWorkSheetObj=nothing
http://hpsqtp.blogspot.com/2009/04/how-to-find-number-of-
rows-and-columns.html
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is the meaning Work bench?
I am Facing Issues with learing datepicker 1)when i first learn datepicker as current system date . 2)if i wanna runtime datepicker value it gives error
Through array we can execute the testcase how ? give me example
what could go wrong with test automation?
How to get the particular property value?
What is the difference between run time object and test object in QTP?
How to use actions in qtp ?
What are private functions in QTP? How they can be called from the function library?
Is QTP Supports SWT applications? If yes, can you write a sample script for opening a new package in eclipse.
how to test load test and block box testing an a web based application pls give ans briefly
Hi all Can u give me the link where we can download full version of qtp my mail id is karthic.venkitapathi@gmail.com
Have you done batch testing in qtp? If yes how you are doing?
I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.
when I was doing the web testing with QTP using with standard checkpoint the Object selection -checkpoint properties dialog box not displaying pages and links hierarchical order. Could you please tell me. thanks
How does qtp recognize objects in aut?