Re: Spreadsheet_Excel_Writer

From: Date: Tue, 07 Oct 2003 22:45:36 +0000
Subject: Re: Spreadsheet_Excel_Writer
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8330@lists.php.net to get a copy of this message
Jeremiah J Griswold wrote:
Whenever I make an xls document, Excel says "File format is not valid". Why doesnt the output xls document work? I am using the simple code given in the tutorial: <?php require_once 'Spreadsheet/Excel/Writer.php'; $workbook=new Spreadsheet_Excel_Writer('test.xls'); $worksheet =& $workbook->addWorksheet('sheetone'); $workbook -> close(); ?>
Just looking at the above code, maybe you're getting a PHP error (see below), but the Content-Type is being sent so Excel is trying to read the file. Try changing
    $workbook -> close();
to
    $workbook->close();
and see if that makes a difference. -- Marshall Roch

« previous php.pear.general (#8330) next »