Lost all formulas in the excel sheet while saving

Topics: Developer Forum
Mar 27, 2013 at 11:16 AM
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?
Mar 28, 2013 at 10:23 AM
Anybody knows the answer?
I am trying to edit the existing excel sheet with formulas.
Mar 28, 2013 at 10: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.
Mar 28, 2013 at 11:04 AM

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);

        ->setCellValue('B3', $latitude)
        ->setCellValue('B4', $longitude)
        ->setCellValue('B5', $country)
        ->setCellValue('B6', $state)
        ->setCellValue('B7', $address)

        ->setCellValue('L6', $area)
        ->setCellValue('M6', $length)
        ->setCellValue('M8', $breadth;       

$objWriter = PHPExcel_IOFactory::createWriter($objExcel, 'Excel5');
Mar 28, 2013 at 4:26 PM
That narrows down to the one key question:
What are the formulas?
Apr 1, 2013 at 7:14 AM
Hi.. i changed it it excel2007 and now its working