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 |
In a shared Object Repository in QTP if some object is changed how can the other script which is using the same object can be known
CAN WE USE 'BVA' AND 'ECP' IN AUTOMATION?
How can I replace all the text from the QTP script with some other text.
what is difference between application testing and product testing?
why we use check points , In qtp we use the any check points , what r they , when and why
what is ODC and GDC?
HOW TO COUNT NUMBER OF ITEMS PRESENT IN WEB LIST
what is test scheduling?
What is the difference between QTP 8.2 and QTP 9.2 ?
Object repositories types, which and when to use?
Deal All, Recently i face one interview question in one company. str="test12@#3456" In This i want to print like special character and numeric ,word in one script please tell me how to write the code for this Thanks Balaji
Hi Friends,will any body tell to Me for which Auomation Tool their is great Requirement inht eMarket Eithr the QTP or WINRUNNER and for what reason and how long it is going to remain and wat the Scope for the automation Testing In the Future Please tll to Me In Details Ok .