You may have said that you posted too early and that calling close() is the answer to your problem, but it is indeed a mistery documented in the entry for close() in Spreadsheet::WriteExcel.
In addition, close() may be required to prevent perl's garbage collector from disposing of the Workbook, Worksheet and Format objects in the wrong order. Situations where this can occur are:
- If my() was not used to declare the scope of a workbook variable created using new().
- If the new(), add_worksheet() or add_format() methods are called in subroutines.
This is basically a bug, I think. The implementation probably use weak references or something similar which allows objects to be disposed without a discipline needed for correctly handling composite objects. The invoking of close() is the documented workaround.