PHPExcel Freezepane not working

PHPphpexcel

for ($char = 'A'; $char <= 'Z'; $char++) {
  $objPHPExcel->getActiveSheet()->setCellValue($char.'5','40');
}
for ($i=1;$i<=100;$i++){
    $objPHPExcel->getActiveSheet()->setCellValue('A'.$i,generateRandomString());
}
$objPHPExcel->getActiveSheet()->freezePane('B');
// Write the PHPExcel object to browser as HTML
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
$objWriter->save('php://output');

$objPHPExcel->getActiveSheet()->freezePane('B');

Freeze not happened for the " A " (First column) column.

Attached screen shot FYI.showing first column(A Col) details here
Freeze not happened for the " A " (First column) column.
When i scroll COL A not freeze, col A also hidding.
When i scroll COL A not freeze, col A also hidding.

Best Answer

the freezePane() coordinate should be a cell reference for the top-left cell of the non-frozen part of the worksheet, so

$objPHPExcel->getActiveSheet()->freezePane('B2');

tells Excel to freeze rows above row 2, and to the left of column "B"... i.e. row 1 and column "A" will be frozen.

Related Topic