It may not work this way with OpenOffice. What this code creates is not an Excel file, it is an HTML table. Excel just happens to be able to read HTML files that contain tables, and imports those into sheets. Before you go further down this road, make sure that OpenOffice is capable of doing that, too. I wouldn't be surprised if it isn't.