xls - Create New Workbook

Code to create a new xls workbook:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
public boolean newWB(String fileName){
 try {
  HSSFWorkbook wb = new HSSFWorkbook();
  FileOutputStream fileOut = new FileOutputStream(fileName);
  wb.write(fileOut);
  fileOut.close();
  } catch (Exception e) {
  e.printStackTrace();
  return false;
 }
  return true;
}