total number of sheets in an Excel file

Topics: Developer Forum, User Forum
Apr 29, 2009 at 3:36 PM
How do i get the total number of sheets in one Excel file?
Developer
Apr 29, 2009 at 3:40 PM
Edited Apr 29, 2009 at 3:40 PM
<?php
$reader = PHPExcel_IOFactory::createReader('Excel2007');
$excel = $reader->load('test.xlsx');

echo 'Total number of sheets: ' . count($excel->getAllSheets());
?>

Apr 30, 2009 at 9:45 AM
thanks a lot koyama!