you need to create at least one sheet. a workbook without sheets is invalid.
Yegor On Tue, Aug 20, 2013 at 5:52 PM, Dominik Stadler <dominik.stad...@gmx.at>wrote: > Hi, > > I just found that xlsx-files produced by the latest builds of poi cannot be > opened in my version of Excel any more, anybody else have similar problems > or is this something related to my local environment? > > Even the simplest possible file already is reported corrupt for me, anybody > seeing this as well? The files can be read fine by POI itself, 3.9 seems to > still work fine, I am still testing 3.10beta1 to narrow it down... > > Workbook workbook = new XSSFWorkbook(); > > String filename = "C:\\temp\\poi-bug.xlsx"; > FileOutputStream file = new FileOutputStream(filename); > try { > workbook.write(file); > } finally { > file.close(); > } > > Dominik. >