I want to explicitly set a cell’s datatype as a text for number values.
I am fetching data from my MySQL database and exporting to excel file using PHPExcel Library.
$objPHPExcel->getActiveSheet()
->getStyle('A'.$i)
->getNumberFormat()
->setFormatCode(
PHPExcel_Style_NumberFormat::FORMAT_TEXT
);
I've not tested it, but possibly setting the cell as "quotePrefix" may prevent MS Excel from trying to convert the datatype when editing it with MS Excel
$objPHPExcel->getActiveSheet()
->getStyle('A2:O128')
->setQuotePrefix(true);
Excel2007 only