This project has moved. For the latest updates, please go here.
1
Vote

Error While loading excel sheet

description

I am trying to load excel sheet (generated by other application) using phpexcel library, with following code

$objReader = new PHPExcel_Reader_Excel2007();
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load('callsheet.xlsx');
//var_dump($objPHPExcel);
$objPHPExcel->setActiveSheetIndex(0);
$dataArray = $objPHPExcel->getActiveSheet()->toArray(null, true,true,true);

var_dump($dataArray);

But I got this error.

Fatal error: Uncaught exception 'PHPExcel_Exception' with message 'You tried to set a sheet active by the out of bounds index: 0. The actual number of sheets is 0.' in E:\xampp\htdocs\podioexcel\Classes\PHPExcel.php:688 Stack trace: #0 E:\xampp\htdocs\podioexcel\test.php(18): PHPExcel->setActiveSheetIndex(0) #1 {main} thrown in E:\xampp\htdocs\podioexcel\Classes\PHPExcel.php on line 688


One interesting thing. when I open same excel sheet and just save file without any change. Than this code work fine , but problem is that I,m not going to open file each time before to use it. Can you please help me to fix this issue. I,ve also attached excel sheet.

file attachments

comments