Can't read string cells

Topics: Developer Forum
Feb 4, 2015 at 1:37 PM
Edited Feb 4, 2015 at 1:51 PM
Hi, please help!
I trying read xlsx table, but something goes wrong.
"$objSheet->getCell('B5')->getValue()" returns "#NULL!", but must returned string values like a "D-LINK". Cells that have a integer value returned correct.
        $objReader = PHPExcel_IOFactory::createReader('Excel2007');
        $objReader->setReadDataOnly(true);

        $objPHPExcel = $objReader->load("table.xlsx");
        $objWorksheet = $objPHPExcel->getActiveSheet();
        foreach ($objWorksheet->getRowIterator() as $row) {
            $cellIterator = $row->getCellIterator();
            $cellIterator->setIterateOnlyExistingCells(false);
            foreach ($cellIterator as $cell) {
              echo $cell->getValue()."\n";
            }
        }
this code printed something like this:
274
20
#NULL!
2
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
2
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
2
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
#NULL!
So, any string value is "#NULL!".
Coordinator
Feb 4, 2015 at 2:49 PM
SO there's something wrong! Let me get my crystal ball out and try and see what it might be...... PHPExcel is reading your file, and the file is telling PHPExcel that it has a lot of error #NULL! values in cells. Perhaps if only I could see the actual file, but it's a bit misty trying to look further in the crystal ball
Feb 5, 2015 at 5:57 AM
Sorry, it's my first post about trouble in english-speaking internet. =D
Cool. )) If you can cast a look this bad file, download this file here
https://www.dropbox.com/s/cjhxeiqcyeexj4q/stock-04.02.2015.xlsx?dl=0