How to know the type of a sheet in workbook?

Topics: Developer Forum, Project Management Forum, User Forum
May 8, 2013 at 1:43 PM
In an Excel workbook there can be 2 or more type of sheet, for example worksheet and chart as a sheet. I am trying the following code:
<?php
require_once 'plug-ins/phpexcel/PHPExcel.php';
$objPHPExcel = new PHPExcel_Reader_Excel2007();
try
{   $objPHPExcel = $objPHPExcel->load('excel-uploads/Book3.xls');
    $prodData = $objPHPExcel->getActiveSheet()->toArray();
}
catch(Exception $e)
{   if($e->getMessage() == 'ZipArchive library is not enabled')
        echo "Incorrect file format";
    else
        echo 'Error: '.$e->getMessage();
}
unset($objPHPExcel);
?>
Book3.xls has only one sheet and it is a chart sheet. If the above code is executed, the following error is occurring:
Fatal error: Class 'ZipArchive' not found in [path]\plug-ins\phpexcel\PHPExcel\Reader\Excel2007.php on line 497

So, what to do to know the type of the sheet or what is the workaround for this problem? And also, why this error is not getting caught in the try-catch block?