Good morning poi-list!
I am reading an XLS file which will be modified (using POI 3.6).
How can I write it back to the file system as an XLSX file?
The thought of it seems easy, yet, I can't find a possibility to do so...
I read the file as follows:
File inFile = new File("template.xls");
InputStream bIn = new BufferedInputStream(new FileInputStream(inFile));
Workbook wb = WorkbookFactory.create(bIn);
[...do something...]
I write as follows:
File outFile = "out.xlsx";
BufferedOutputStream bOut = new BufferedOutputStream(new
FileOutputStream(outFile));
wb.write(bOut);
Excel then fails loading the document stating that it encountered an unexpected
file format (The XLSX is probably simply an XLS file)
Thank you!
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]