public static void main(String[] args) throws Exception { // The path to the documents directory. String dataDir = Utils.getDataDir(ApacheHideUnHideCells.class); InputStream inStream = new FileInputStream(dataDir + "workbook.xls"); Workbook workbook = WorkbookFactory.create(inStream); Sheet sheet = workbook.createSheet(); Row row = sheet.createRow(0); row.setZeroHeight(true); FileOutputStream fileOut = new FileOutputStream(dataDir + "ApacheHideUnhideCells.xls"); workbook.write(fileOut); fileOut.close(); System.out.println("Process Completed."); }