Micro Focus QTP (UFT) Forums
Excel used sheets - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Excel used sheets (/Thread-Excel-used-sheets)



Excel used sheets - Sathiya - 05-30-2011

hi
i want to get the number of sheets used in excel.
can any one please help me in this regard





RE: Excel used sheets - Palanimurugana - 05-30-2011

Can you loop thru all the sheet and find the usedrange.rows value for each sheet. if more than zero means u can increment the counter and get the desired from counter value


RE: Excel used sheets - rajpes - 07-06-2011

i don't know if there is a method to count no of sheets in an excel file but one trick is,
try to open a non existing sheet and get that err.Number
Then in your code use a loop to open all sheets one by one meanwhile keep incrementing a variable as no. of sheets till you get that same err.number