I'm trying to get the style of a row e.g. ("A3:V3"), pass it to an array, and then use that array with the applyFromArray();
function.
Here is what i tried:
$objPHPExcel = $objReader->load($inputFileName);
$sheet = $objPHPExcel->getActiveSheet();
$style = $sheet->getStyle("A3:V3");
$sheet->getStyle("A$totalRows:V$totalRows")->applyFromArray($style);
This throws the error 'Invalid style array passed.'
Is there any workaround for this?
I found this in the docs - "If you want to copy the ruleset to other cells, you can duplicate the style object"
$objPHPExcel->getActiveSheet()->duplicateStyle($objPHPExcel->getActiveSheet()->getStyle('B2'), 'B3:B7');
So i didn't have to do this anymore. Should have just searched a little more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With