
Hi,
I am using a large excel sheet with lots of complex formulas. I lose some of the formulas while saving the excel. Can anyone help me?



Anybody knows the answer?
I am trying to edit the existing excel sheet with formulas.


Coordinator
Mar 28, 2013 at 9:58 AM

What format is the Excel file? BIFF (Excel5)? OfficeOpenXML (Excel2007)? Are you reading from a template? or creating the spreadsheet with formulas yourself? What are the formulas? A little bit of detail in a question is always useful to help diagnose
problems.



Hi,
I am trying to update an existing excel file(excel5) with formulas. I am getting correct answers but the problem is i lost all my formulas inside the sheets. i need to preserve all those formulas for the next calculations.
Here is the code i used.
require_once 'Classes/PHPExcel/IOFactory.php';
require_once 'Classes/PHPExcel.php';
$objExcel = PHPExcel_IOFactory::createReader('Excel5');
$xlFile = "sample.xls";
$objExcel = $objExcel>load($xlFile);
$objExcel>setActiveSheetIndexbyName('Master');
$objExcel>getActiveSheet()
>setCellValue('B3', $latitude)
>setCellValue('B4', $longitude)
>setCellValue('B5', $country)
>setCellValue('B6', $state)
>setCellValue('B7', $address)
$objExcel>setActiveSheetIndexbyName('inputs');
$objExcel>getActiveSheet()
>setCellValue('L6', $area)
>setCellValue('M6', $length)
>setCellValue('M8', $breadth;
$objWriter = PHPExcel_IOFactory::createWriter($objExcel, 'Excel5');
$objWriter>setPreCalculateFormulas(false);
$objWriter>save($xlFile);


Coordinator
Mar 28, 2013 at 3:26 PM

That narrows down to the one key question:
What are the formulas?



Hi.. i changed it it excel2007 and now its working

