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
For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?
suppose in the middle of the project QTP will not work properly, then what do u do? and ur team?
How to create a standard checkpoint ?
When do go for loop condition in test?
How do I get the QTP scripts result in xml format by using vb script function?
What is the standard timing delay for web based application in qtp?
What is standalone database?
When we r doing data driven test with chkpts, i want to insert formulae in data sheet but i didn't get. How we wil do that plz. explain in detail.
Can any one say what exact diff between test->parameters, action properties-> parameters. after defining the parameters in test->settings, how can we access those parameters.(i know how to use action prop parameters)
Explain the difference between call to action and copy action?
What are the ways you can synchronize?
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
Hello friends..... On which areas of an application we can not test with QTP
What is the parameterization?
when to start the automation?