Created attachment 26101 [details] Relevant class and JUnit test class To start with, I am creating only a blank file. No worksheets, no data. However, when I attempt to open the file with Excel 2007, I get the following popup: "Excel found unreadable content in 'abc.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes." After clicking Yes, another popup: "The workbook cannot be opened or repaired by Microsoft Excel because it is corrupt." I have attached the relevant class and a JUnit 4 test class. I am using Vista Business Ed SP2, 64 bit with Office 2007 SP2.
Your code just saves an empty workbook which is invalid: wb = new XSSFWorkbook(); wb.write(fileOut); You need to insert at least one sheet to make the workbook readable by Excel, e.g. the following code will produce a valid output: wb = new XSSFWorkbook(); XSSHSheet sh = wb.createSheet(); wb.write(fileOut); Yegor