Invalid cell coordinate COMPETITIE!A21

Topics: User Forum
Mar 2, 2011 at 7:47 PM

Caught exception: Invalid cell coordinate COMPETITIE!A21

php 5.3.5 with apache 2 phpexcel 1.7.6

Code (minimized for localizing test):
         set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/');
         include 'Classes/PHPExcel.php';
         include 'Classes/PHPExcel/Writer/Excel2007.php';
         include 'Classes/PHPExcel/Reader/Excel2007.php';

         $objPHPExcel = new PHPExcel();
         $objReader = new PHPExcel_Reader_Excel2007();
         $objPHPExcel = $objReader->load("VZC.xlsx");

         //Code commented to see error catch
         //header('Pragma: private');
         //header('Cache-control: private, must-revalidate');
         //header("Content-Type: application/vnd.ms-excel");
         //header('Content-Disposition: attachment; filename="Competitie.xlsx"');
         $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
         try {
                             $objWriter->save("php://output");
         } catch (Exception $e) {
             echo 'Caught exception: ', $e->getMessage(), "\n";
         }
 

Cell.php rule 504 added code (which is not the right place to correct, but where else?

// Arjan Dekker ivm errormelding!
//02-03-2011 skip all data till !
if(strpos($pCoordinateString,"!")!==false) {
$pCoordinateString=substr($pCoordinateString,strpos($pCoordinateString,"!")+1);
}
.........if pregmatch........

File used: http://www.xzweml.nl/competitie/VZC.xlsx

Coordinator
Mar 3, 2011 at 9:51 PM

A stack trace indicates that this is the autofilter defined name failing to recognise a reference containing a worksheet name.

You're right: the solution isn't changing the coordinateFromString() method, although this gives you a temporary workround.

The fix is in the _writeDefinedNameForAutofilter() method of the PHPExcel_Writer_Excel2007_Workbook class. I'll patch this in the latest SVN code within the next half hour or so.

Coordinator
Mar 3, 2011 at 9:55 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.