I have created a Workbook/Excel in .xlsx format with Java using Apache POI API successfully. My code is as below that is created a file named \"RiponAlWasim.xlsx\" in D drive:>
It needs to be added at least one sheet to the workbook. So, after creating a worksheet the following code is working well:
Workbook wb = new XSSFWorkbook();
Sheet sheet1 = wb.createSheet("Ripon");
FileOutputStream fileOut = new FileOutputStream("D:\\RiponAlWasim.xlsx");
wb.write(fileOut);
fileOut.close();
wb.close();