set default fill color for all cell is white

Topics: Developer Forum, Project Management Forum, User Forum
Jun 16, 2008 at 4:50 AM
Hi everybody!

I want to set fill for all cell in my sheet is white, I wrote below, it does not work:

$objPHPExcel->getActiveSheet()->getDefaultStyle()->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getDefaultStyle()->getFill()->getStartColor()->setARGB('FFFFFFFF');

 But when i wrote below, it work:

$objPHPExcel->getActiveSheet()->getStyle('B5')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('B5')->getFill()->getStartColor()->setARGB('FFFFFFFF');


please help me!

Thanks everybody!

Coordinator
Jun 16, 2008 at 7:00 AM
Setting background color on the default style is not supported by Excel. This can only be done for specific cells. Font face etc. however can be set on the default style.