Error formatting number after export

Topics: Developer Forum
Sep 21, 2012 at 5:15 PM

I have a system that exports a report to an Excel file using PHPExcel. The problem is that when I use:

$objPHPExcel->getActiveSheet()->setCellValue("F".$i."", utf8_encode($linha['tid']));

Where TID  have from 20 digits (number), it sometimes converts the field to date in Excel (it occurs only with some TID numbers). For example:

if the TID is: 100699306905C1962005 it shows in Excel 05/01/1962  07:06:00

if the TID is: 100699306905C1982002 it shows in Excel 02/01/1982  07:06:00

if the TID is: 100699306905C1971001 it shows in Excel 01/01/1971  07:06:00

It does not occur with 10366890150000961001 or with 10366890150000A82005, that are showed ok.

The problem is that i cant change the TID numbers format because I receive them from another system.

Anyone know how can I solve it. Could you please help me? I tried a lot of things with no success.

Thanks a lot.