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 r the main benefits of automation?
Hi,Every one,my name is RAHUL,aim wondering if any one got QTP software? If yes,can u plz knock on to gchinthakindhi@gmail/yahoo.com. THANK U.
What is object state in trigger events,in recovery scenario.write a script to handle this.
what is check point?
my assignment is,how can i differentiate between readed & unreaded mails in my inbox ?, since for both readed & unreaded having same properties for both test objects &run time objects
How do u insert an object during runtime in qtp?
pls help me with scripting,right from the beginning in QTP
How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?
How to handle Dynamic Arrays?
Hi friend I have query regarding QTP datatable. I want to insert data in datatable during runtime. suppose i wrote datatble.value(1) = "Test data" so when i run the script it says column(1) doesn't exist. Then i write something in column A1 manualy and run the script again. Now it works fine. Pls clarify how i can put value in blank cell of datatable.
How i can use and create Library functions in QTP and what is the proces .
How QTP identify the system time that's changes every seconds?