Rows written by PHPExcel cannot be read from other libraries

Jun 25, 2010 at 1:00 AM

I am writting an Excel5 over an existing Excel file with PHPExcel. I need to upload that Excel to the Zoom website, so it can provide me with a list of tracking numbers. However, for some reason the library they are using to read the uploaded Excel files cannot read the rows written by PHPExcel and the only solution I've found so far is to manually copy the contents of my dynamically generated Excel to another document using MS Excel 2007.

In other words, the Zoom website can read the rows in files written natively by Excel but not rows written by PHPExcel. My file has only one single sheet, and I can open it no problem with Excel 2007. 

Even if I manually add some rows to the template and then add more rows with PHPExcel, Zoom will read the rows written manually by me, but not the rows written by PHPExcel.

This is how I am writting it:

// Starting with the PHPExcel library
$template_file = 'zoom_tracking_template.xls';
$i = 3;

$objReader = IOFactory::createReader('Excel5');
$objPHPExcel = $objReader->load($template_file);

// Fetching ML payments
foreach($payments as $row)
	$objPHPExcel->getActiveSheet()->setCellValue('A'.$i, 'VANESSA NEISZER');
	$objPHPExcel->getActiveSheet()->setCellValue('B'.$i, '02127616116');
	$objPHPExcel->getActiveSheet()->setCellValue('C'.$i, '1ER PISO MINITIENDAS 199 BLVD SABANA GRANDE, CRUCE C / CALLE NEGRIN');
	$objPHPExcel->getActiveSheet()->setCellValue('D'.$i, $row->mailing_city);
	$objPHPExcel->getActiveSheet()->setCellValue('E'.$i, $row->mailing_name);
	$objPHPExcel->getActiveSheet()->setCellValue('F'.$i, $row->mailing_name);
	$objPHPExcel->getActiveSheet()->setCellValue('G'.$i, $row->mailing_personal_id);
	$objPHPExcel->getActiveSheet()->setCellValue('H'.$i, $row->mailing_phone);
	$objPHPExcel->getActiveSheet()->setCellValue('I'.$i, $row->mailing_address1.' '.$row->mailing_address2);
	$objPHPExcel->getActiveSheet()->setCellValue('J'.$i, $row->nickname);
	$objPHPExcel->getActiveSheet()->setCellValue('K'.$i, '1');
	$objPHPExcel->getActiveSheet()->setCellValue('L'.$i, '0.3');
	$objPHPExcel->getActiveSheet()->setCellValue('M'.$i, 'M');
	$objPHPExcel->getActiveSheet()->setCellValue('N'.$i, 'PRODUCTO');
	$objPHPExcel->getActiveSheet()->setCellValue('O'.$i, '0');


$objWriter = IOFactory::createWriter($objPHPExcel, 'Excel5');
// Sending headers to force the user to download the file
header('Content-Type: application/');
header('Content-Disposition: attachment;filename="Envios'.date('dMy').'.xls"');
header('Cache-Control: max-age=0');

Does anyone have any idea of why this could be happening? I have no clue of what PHP library they are using to read Excel files and I am certain they wont tell me if I ask them. I know they use PHP, and their library only read Excel 2003 files, however, I don't know why they can't read my files but they can read other files written manually on MS Excel.

Any clues, ideas or suggestions I could try would be greatly appreciated.