PHPExcel Freezepane not working

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');

Slowdown did not occur for column "A" (first column).

Attached FYI screen shot. showing first column (A Col) details here Freezing did not occur for column "A" (first column). When I scroll through COL A, I don't freeze, col A also lights up. When i scroll COL A not freeze, col A also hidding.

+7
source share
2 answers

the freezePane () coordinate must be the cell reference for the upper left cell of the unfrozen part of the worksheet, therefore

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

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

+18
source

Try the following:

 $ColumnCount=0; $RowIndex=8; $objPHPExcel->getActiveSheet()->freezePaneByColumnAndRow($ColumnCount, $RowIndex); 
+2
source

All Articles