2
votes

I am designing a few scripts to write Excel files from MySQL stored data.

Unfortunately I need to design it for use for a company wide intranet and the down-side is some of the systems are runnin Citrix with Office 2000 (yep that's right Excel 2000)

I am using the PHPExcel package and it is writing the files great, but they just open as jumbled chars in 2000.

I am currently using Excel5 output as I thought that would have better compatability

$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
$objWriter->save($excelOutputFile);

I know the solutions really should be to upgrade the stupid old obsolete Citrix systems... or to export to CSV files instead of Excel but these are the paramaters for the project and the finance team aren't the greatest people to try and negotiate with. So I would like to try and find a solution in PHP for the current systems if possible.

Anyone have any recommendations or pointers?

1
Do they open successfully in some other versions of Excel? - Petr Abdulin
Yeah it opens perfectly in 2007. I am pushing for them to just upgrade the cruddy old machines to avoid the issue. - elzaer
By jumbled chars you mean that only text is corrupted, or file is totally unreadable by Excel 2000? - Petr Abdulin
totally unreadable, like when you open a binary file in notepad or the like. - elzaer
Excel5 written files should open cleanly in Excel2000. It's most likely that somewhere in the file there is some corruption caused by an output from echoed characters or similar. Open the file in a text editor, and see if you have any leading or trailing white space characters, or any obvious PHP texts such as errors visible in the files. If you, can you please provide a sanitized output and sample script from on the codeplex forums so we can investigate. - Mark Baker

1 Answers

1
votes

If you are not opposed to switching to a different library, assuming it has the features you need, this one (CSVtoXLS) is supposedly tested on Excel 2000. It looks like a straight up converter from csv to xls files, but it might be a good starting point.