maintaining references to external worksheets (without having to deal with them)

Topics: User Forum
Jul 8, 2013 at 6:12 PM
Hi,

I have a file with links to external worksheets. I am aware of the fact that PHPExcel will not handle these, and this is ok for my needs, as I would like to use it to update parts of the file which do not contain the external references.

However, when trying to save the sheet and I re-open it, I will find "Err!520" instead of the external references.

I'd just like to double check if the "not handling" the external references also implies losing the formulas, or if I am missing some step in the process.

below is the code I am using

<?
require_once 'PHPExcel/Classes/PHPExcel.php';
$excel2 = PHPExcel_IOFactory::load('data/m2.xls');
PHPExcel_Calculation::getInstance()->disableCalculationCache();
$excel2->setActiveSheetIndexByName('Sheet1') ->setCellValue('C32', 'aaa');
$objWriter = PHPExcel_IOFactory::createWriter($excel2, 'Excel5');
$objWriter->save('data/m2.xls');
?>

TIA for any feedback

Andrea
Jul 9, 2013 at 10:32 AM
If you disable the formula pre-calculation ?
$objWriter->setPreCalculateFormulas(false);
Jul 9, 2013 at 10:52 AM
thanks for the suggestion...I tried to add the line to the test script, however I am still getting the Err!520 ...

in the meantime I had an update from the provider of the data I am working on, and they have embedded the data in the sheet, so the issue is less critical at this point (while it may be interesting to have a confirmation of the issue)

best regards
Coordinator
Jul 9, 2013 at 11:09 AM
External references are preserved in workbooks read/written with Excel2007; but not with any of the other formats such as Excel5
Jul 9, 2013 at 11:11 AM
ok - thanks for the clarification regards