The xls contain data. how to get number of columns form
the sheet?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ur
To get the column count use.
allCols = DataTable.GlobalSheet.GetParameterCount
Msgbox allCols
Is This Answer Correct ? | 5 Yes | 2 No |
for outside xls sheet we have follow below
datatable.addsheet("Sheetname")
datatable.importsheet("sheetname",sheetid,"sheetpath")
rowcount=datatable.getsheet("sheetname").getrowcount
msgbox(rowcount)
for globalsheet
rowcount=datatabe("GlobalSheet").getrowcount
msgbox (rowcount)
for actionsheet
rowcount=datatable("LocalSheet").getrowcount
msgbox (rowcount)
Is This Answer Correct ? | 2 Yes | 4 No |
How to save your test using quicktest professional (qtp)?
hi i have one isuue on selecting webcheckbox .there are 15 wecheckboxex i want to select every time 9 th one how can i select plese help me regards balaji
According to use, how virtual object is different from object spy? If Qtp is not learning a sub-menues. What should we done? how would we manage on the expert view too? alkaa.dugaal@gmail.com
Please clarify Automation and QTP both(names) are same or diff?
What is an Regular expression doing in VBScript?Tell the pattern for the email verification.
What is exact difference between “while” and “do while” in QTP ?
Read excel using qtp descriptive programing
When ‘option explicit’ keyword is used in qtp?
How do I get the QTP scripts result in xml format by using vb script function?
Out of 3 recording modes. 1.Standard 2.Analog 3.Low-level, which one is commonly used. As per my knowledge, Analog is used for Graphs , barcoding or DIgital signatures.
Pls let me know completely about descriptive programming, where it is used, pls explain with a real time example of its occurence and the program code written in qtp.
in login module login button chage regularly(means login button change to submit button).What is the code for it.