Workbook wb = new HSSFWorkbook(); FileOutputStream fileOut; fileOut = new FileOutputStream("newWorkbook.xls"); wb.write(fileOut); fileOut.close();
Workbook workbook = new Workbook(); // Creating a Workbook object workbook.save("newWorkBook.xlsx", FileFormatType.XLSX); //Workbooks can be saved in many formats