SOLVED: error style formatting applyFromArray ?

Mar 4, 2011 at 1:02 PM
Edited Mar 4, 2011 at 1:51 PM

Any clues to this one (using 1.7.6) - was working previously

Fatal error: Uncaught exception 'Exception' with message 'Invalid cell coordinate 'A1' in /var/www/html/dailyreport/classes/PHPExcel/Cell.php:508

Stack trace: #0 /var/www/html/dailyreport/classes/PHPExcel/Style.php(279):

PHPExcel_Cell::coordinateFromString(''A1') #1 /var/www/html/dailyreport/excel_creation.php(179):

PHPExcel_Style->applyFromArray(Array) #2 /var/www/html/dailyreport/cronjobs/customers_stats_new_live.php(360):

require_once('/var/www/html/d...') #3 {main} thrown in /var/www/html/dailyreport/classes/PHPExcel/Cell.php on line 508

line 179 = $objPHPExcel->getActiveSheet()->getStyle("'A".$headernr.":".$formattmp.($rowcounter+1)."'")->applyFromArray($headingformat);

applyFromArray - the array is so

$headingformat= array(
    'alignment' => array(
        'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,
    ),
    'font' => array(
        'bold' => true,
    )
);

Problem solved - my mistake a ' too many

May help someone but do not enclose your range ie do not do ('A1:B1') - you will get an error

use (A1:B1) only

 

 

thanks