The below code will demonstrate how to count number of used rows in Excel without opening it - using vbscipt in QTP.
Set objXls=CreateObject("Excel.Application")
Set objWB=objXls.WorkBooks.Open("C:\a.xls")
Set objSheet=objWB.WorkSheets(1)
MsgBox objSheet.UsedRange.Rows.Count
Set objXls=Nothing
No comments:
Post a Comment