GUI Reverses when editing an Excel file with formula

Topics: Developer Forum, User Forum
Jul 26, 2011 at 9:07 AM

Hi

 

I am using the following code to modify a template excel sheet with a very basic formula .i.e =SUM(B1,B2,C1,D2) 

 

include 'Classes/PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
 
//we load the file that we want to read
 
$objPHPExcel = $objReader->load("test.xlsx");
 
//we change the file
 
$objPHPExcel->getActiveSheet()
->setCellValue('A1','EEEEEEEEE')
->setCellValue('A2','DDDDDDDDDDDD')
->setCellValue('A3','CCCCCCCCC')
->setCellValue('A4','BBBBBBBBBB')
->setCellValue('A5','AAAAAAAAAAAAA')
->setCellValue('A29','MaitrePylos');
 
 
//we create a new file
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
 
//we save
$objWriter->save('coco.xlsx');

 

 

The new generated file will be generated with reversed GUI. Where as if I remove the SUM formula then everything works fine.


PFA excel file for example.

http://hotfile.com/dl/125035599/f1c007b/test.xlsx.html

http://hotfile.com/dl/125035364/35c2d2d/coco.xlsx.html

 


Does anyone have any idea how to fix this?

 

Thanks in advance

Nov 16, 2011 at 1:31 PM

I also faced same issue.

 

Steps to reproduce this issue:

1) create excel file using phpexcel lib.

2) download the file  and edit it libre-office.

3) upload the edited file. Try to alter few cells through code using phpexcel and save the file using the phpexcel.

The final file will have reverse GUI as explained in the previous post.

Thanks and Regards,

Velagamk