Style Border Color

Dec 6, 2011 at 5:52 PM

I have had no luck figuring out how to change the color of a set border. I have no issues creating the border, just unable to color it anything but black.


Here is the code I use to create the borders, I am not using an array to do so, is there a way to color the border without having to use an array?



Dec 6, 2011 at 10:45 PM
$styleArray = array(
       'borders' => array(
             'outline' => array(
                    'style' => PHPExcel_Style_Border::BORDER_THIN,
                    'color' => array('argb' => 'FFFF0000'),



$objPHPExcel->getActiveSheet()->getStyle('A2:L2')->getBorders()->getAllBorders()->setColor(new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_RED));

Personally, I prefer using the applyFromArray() method