views:

81

answers:

0

Hi,

I am working on a project using Apache POI HSSF. In this project I import data from some spreadsheets and export the imported data to another spreadhseet. This all works fine but there is one little flaw:

When I export the data to a spreadsheet it seems like it isn't written finally. When I open the document in Excel all values are inserted in the correct cells but as soon as I close Excel a dialog asks whether I wanted to save my changes (though I didn't do any changes manually in that document). Only if I save the document manually after I opened it the data seems to be finally inserted to that document. If I import a document to which I exported my values before without doing that manual saving-process, POI only imports null-values.

I write my data according to the Apache POI-Guide:

FileOutputStream fileOut = new FileOutputStream(workbook);
wb.write(fileOut);
fileOut.close();

Does anyone know a solution to that problem?