Pear Spreadsheet writer - writing 0 byte file

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
When I try examples from the docs, it writes out a 0 byte *.xls file.  For  
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();

$format_bold =& $workbook->addFormat();

$format_title =& $workbook->addFormat();

$worksheet =& $workbook->addWorksheet();
$worksheet->write(0, 0, "Quarterly Profits for Dotcom.Com", $format_title);
// While we are at it, why not throw some more numbers around
$worksheet->write(1, 0, "Quarter", $format_bold);
$worksheet->write(1, 1, "Profit", $format_bold);
$worksheet->write(2, 0, "Q1");
$worksheet->write(2, 1, 0);
$worksheet->write(3, 0, "Q2");
$worksheet->write(3, 1, 0);

?>My installation is:
PHP 4.3
OpenOffice 2.3 (but it doesn't open in MS Excel either)
OLE 0.5 beta
Spreadsheet_Excel_Writer 0.9.1 beta

Any ideas what's going wrong?  

Re: Pear Spreadsheet writer - writing 0 byte file

Quoted text here. Click to load it

Yeah you need to specify a filename for the Spreadsheet_Excel_Writer
$workbook = new Spreadsheet_Excel_Writer('filename');

Site Timeline