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
How many types of parameters are there?
How to use actions in qtp ?
How to capture dynamic values in load runner and how Each of the captured values are to be written to a text file (c:\temp\LoadRunner1.txt)
What is checkpoint in qtp?
Where we can use the synchronization?
What are test settings and global settings?
How to use the object spy in quicktest professional (qtp) 8.0 version?
Where you are storing your script?
how can i sent QTP results to the Html, notefile ,xl file give me the code using g mail login page
How can get count of list box?
Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks
Explain advantages and disadvantages of ddf?
What is the XML file architecture ?
In qtp, how you can remove the spaces from string?
What is a checkpoint? How many check points are there in qtp?