Data validation problem with Excel2007 writer open on Excel 2003

Topics: Developer Forum
Jul 1, 2009 at 9:07 AM


I have a problem with data validation when I open my file with Excel 2003.

The problem occurs when my data validation refers to a cell which is before the cell where the data validation is. Here an example :

Data validation on cell B1, the operation is "greater than" the cell A1 => in that case I have an error message on opening

Data validation on cell B1, the operation is "greater then" the cell C1 => in that case I haven't an error message on opening

In all cases, the file is fully operationnal even if I have the error message on opening.

Here the error message (sorry it's a french version ;-) )

I give you my test code :

$excel = new PHPExcel();

// Must set value (or style) on cell to have data validation on it (another issue maybe)

$objValidation = new PHPExcel_Cell_DataValidation();
$objValidation->setError("Invalid input");


$objWriter = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
$objWriter->setOffice2003Compatibility(true);        // Try also to set it to false with the same result

Thanks for your help

Jul 1, 2009 at 12:52 PM

I can verify this problem. Interestingly, opening in MS Office Excel 2007, no problem.

Copying to work item: