define dynamic named range

Topics: Developer Forum, User Forum
Mar 14, 2011 at 3:40 PM

Hi,

I have defined "fixed" dynamic ranges with PHPExcel, but I can't get dynamic named ranges to work :

 

$objPHPExcel->addNamedRange( new PHPExcel_NamedRange('rngSomething', $objPHPExcel->getActiveSheet(),

=OFFSET(theSheet!$J$2;0;0;COUNTA(theSheet!$J:$J)-1,1)'));

 

error thrown is "Invalid cell coordinate" so I guess PHPexcel cannot handle function references there ??

 

 

Coordinator
Mar 14, 2011 at 4:01 PM

Try using a comma , rather than a semi-colon ; as an argument separator

Mar 15, 2011 at 9:35 AM

sorry my mistake : I have tried both actually (and a bit more consistent as in my first post) and both throw the error :

 

 

'=OFFSET(theSheet!H$2;0;0;COUNTA(theSheet!$H:$H)-1;1)'

'=OFFSET(theSheet!H$2,0,0,COUNTA(theSheet!$H:$H)-1,1)'

 

 

My Excel uses semicolons and have mixed them up in the beginning, PHPEXcel indeed handles commas