Weird problem with setting cell background color

Topics: Developer Forum
Apr 24, 2014 at 6:19 PM
Edited Apr 24, 2014 at 6:20 PM
In my code, it sets the cell background color of cells.


And the program should goes from G3 to L289, but error occurred at K142. This program runs fine with generating other files, but this one. I am wondering if it reaches the limit of the range (G3 to K142?). After I comment out the set color line of code, the file generates fine.
    //do entry validation and unlock the input cells for student score
    for ($column = 'G'; $column != $lastColumn; $column++) {

        for ($row = 3; $row <= $endRow; $row++) {
            $cellIndex = $column.$row;

            //data validation; only accept 1, 2, 3 or 4
            $objValidation = $objSheet->getCell($cellIndex)->getDataValidation();

            $objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_LIST );
            $objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_STOP );
            $objValidation->setErrorTitle('Input error');
            $objValidation->setError('It has to be 1, 2, 3, 4 or x.');
            $objValidation->setPromptTitle('Pick from list');
            $objValidation->setPrompt('Please pick a value from the drop-down list.');

            //unlock the cell

            echo $cellIndex;
            echo ' ';

            //highlight the cell

            //set the border style to thin