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 |
What is the file extension of the code file & object repository file in QTP?
Can we use index on view?
What is runtime objects and test objects? What is the difference between them?
How to make arguments optional in a function?
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
When u r running a script , if u get a popup window that describing that u have received a mail to your outlook application. so to avoid the interference of the popup window , which recovery scenario(popup,object state,application hang,system crash) would u use ?
How to suppress warnings from the test results page?
tell me types of environment variables? what r they? explain details? pls give anwer any one?
Give me the Example of standard check point and text check point with syntax?
3 Answers IMI Soft, IMI Soft Engineering,
i am unable to select an item from combobox using Descriptive programming. can any one give me code for scheduling the ticket using Descriptive programming.
What is a recovery scenario?
How does QTP identifies the object in the application?