Cell format changing after deleting row

Topics: Developer Forum, Project Management Forum, User Forum
Dec 2, 2012 at 6:06 PM

Hi All,

I'm having a little problem with a file that is generated using PHPExcel.  The site I am using pulls data from an SQL database and puts it on a spreadsheet.  Some of the data that is pulled are SKU numbers beginning with a 0.  When they are initially written to the sheet, the cells are formatted as text, and they display fine, but when it becomes necessary to delete a row, all the cells below the deleted line change back to default format, and SKU numbers beginning with 0 are no longer displaying correctly.  Below is the code snippet I have used to try to set the cells back to text format instead of numbers:


And here is the snippet I used in a previous file to set the entire sheet to text:


Can anyone offer a suggestion for what I may be doing wrong, or perhaps if this is a bug?  

Thanks for reading!

Dec 4, 2012 at 1:41 AM

I fixed my problem, if anyone else ever finds themselves in my shoes, and finds this thread, here's what I did:

Change the way the cells are written from regular to rich text.  See the code snippet below:

$objRichText = new PHPExcel_RichText( $objPHPExcel->getActiveSheet()->getCell('B1') );