Pages

Wednesday, March 2

Count number of rows in Excel without opening it.


'Following code demonstrate how to count number of rows in Excel without opening it - using vbscipt in QTP.

Set objExcel=CreateObject("Excel.Application")
Set objWB=objExcel.WorkBooks.Open("C:\abc.xls")
Set objSheet=objWB.WorkSheets(1)
msgbox objSheet.usedrange.rows.count
Set objExcel=Nothing

9 comments:

  1. Its very helpful... Thanks buddy..!!!

    ReplyDelete
  2. I've looked at 10 other forums looking for exactly this. None of the other solutions are as elegant as this one. Good work.

    ReplyDelete
  3. These people both equally knowledgeable local college students in addition to beyond state and college students via various other places and nations and training 's best one way to create your profession. http://www.trustessaywriting.com/blog/compare-and-contrast-essay-topics for quality and on time writing services with responsible cost.

    ReplyDelete
  4. Excellent, Thank you very much

    ReplyDelete
  5. Thanks for this short yet apt code

    ReplyDelete