solid fill with custom color

Topics: User Forum
Oct 31, 2008 at 10:24 AM

Hi, been struggling w/ filling a cell with custom color.... can anybody put me into this? thanx

Oct 31, 2008 at 10:39 AM
Try this to fill cells B1:D10 with red color.

$excel = new PHPExcel();
$sheet = $excel->getActiveSheet();

        'fill' => array(
            'type' => PHPExcel_Style_Fill::FILL_SOLID,
            'startcolor' => array(
                'rgb' => 'FF0000',

$writer = new PHPExcel_Writer_Excel2007($excel);

Oct 31, 2008 at 10:59 AM

oh. thanx. so it is STARTCOLOR - i've read a bit of source and seen "color" parameter - startcolor seems quite confusing, when its the only color in the fill :))

thanx for swift reply, koyama!