getVisible(): how to skip hidden rows

Topics: User Forum
Jan 14, 2014 at 4:57 PM
Hi there,

I'm using PHPExcel to read some spreadsheets which happen to have some rows hidden. I want to ignore those rows, for that I think I should use attribute getVisible() but I don't know how to integrate it in my code.

Could somebody help?

After loading/reading the input file, the My PHP code looks like this:
    $sheet = $objPHPExcel->getSheet(2);
    $highestColumn = $sheet->getHighestColumn();
    //  Loop through each row of the worksheet in turn
    for ($rowNum = 8; $rowNum <= $highestRow; $rowNum++){ 
        //  Read a row of data into an array
        $rowData = $sheet->rangeToArray('D' . $rowNum . ':' . 'F' . $rowNum, NULL, TRUE, FALSE); 
Thanks a lot in advance.

Cheers, Manuel
Jan 14, 2014 at 5:48 PM
Assuming that you've loaded this workbook with the Excel2007 Reader, there is a known problem with that Reader loading hidden rows, which has been fixed in the latest develop branch on github
Jan 17, 2014 at 11:22 AM
Thank you, Mark!

I'm not sure whether I'm using Excel 2007 Reader. My code for loading the file is:
        $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
        $objReader = PHPExcel_IOFactory::createReader($inputFileType);
        $objPHPExcel = $objReader->load($inputFileName);
I'm using PHPExcel version 1.7.9, 2013-06-02.

I understand that the fix you mention hasn't been released yet in the stable version of PHPExcel. Is my understanding correct? If yes, is there any forecast of when it will be?

Thanks again!

Cheers, Manuel