Keep getting 'Could not close zip file' error

Topics: User Forum
Oct 27, 2008 at 9:35 PM
I am using PHP 5.2.6 and PHPExcel 1.6.4 (downloaded today).

Everytime that I run one of the examples (e.g. 01simple.php) I get the following error:

15:29:39 Create new PHPExcel object
15:29:39 Set properties
15:29:39 Add some data
15:29:39 Rename sheet
15:29:39 Write to Excel2007 format

Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file C:\Documents and Settings\randy\My Documents\Aptana Studio\PHPExcel\Tests\01simple.xlsx.' in C:\Documents and Settings\randy\My Documents\Aptana Studio\PHPExcel\Classes\PHPExcel\Writer\Excel2007.php:383 Stack trace: #0 C:\Documents and Settings\randy\My Documents\Aptana Studio\PHPExcel\Tests\01simple.php(75): PHPExcel_Writer_Excel2007->save('C:\Documents an...') #1 {main} thrown in C:\Documents and Settings\randy\My Documents\Aptana Studio\PHPExcel\Classes\PHPExcel\Writer\Excel2007.php on line 383

Can you point me in the right direction of how to solve this?

Is there a permission problem?

Any help is appreciated.

Thanks in advance...

Randy




Developer
Oct 28, 2008 at 5:13 AM
Yes, this looks like the error message you get when the Excel file cannot be saved due to write permission problem. Not sure about your Windows platform. Try to create a separate PHP script that just saves a file on disk. After you get that working then PHPExcel will probably also work.