Formatting Cells as String

Topics: User Forum
Feb 7, 2013 at 7:35 AM
How do I force a cell value to be treated as a string in Excel, even though the value looks like a long (integer) number (e.g. "123456789123456789")?
I want it to be displayed and treated as-is, without it being reformatted to something like 1.23456789E+17. Thanks!
Feb 7, 2013 at 7:38 AM
Feb 7, 2013 at 7:54 AM
Thanks Mark, but I tried both setCellValueExplicit() and setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT), and still the value shows up in exponential form when I open the sheet. Might there be another reason behind that, like locale or other display settings in Excel?
Feb 7, 2013 at 7:57 AM
Oh, nevermind. It might have been a totally different problem; I just ran the same code again, now I get the full string and a green mark in the top left corner (just as you would expect :-) -- Thanks!