Agree with Akokskis, write twice, causing problems, but you can try reloading the book after writing, then it will do just fine. for example
FileOutputStream fileOut = new FileOutputStream("Workbook.xlsx"); wb.write(fileOut); fileOut.close(); wb = new XSSFWorkbook(new FileInputStream("Workbook.xlsx"));
Sankumarsingh
source share