title: xls file is corrupted after upgrading apache poi from version 4.0.1 to the latest versions ( version 4.1.2 and version 5.0.0)
body: <p>The below code  works fine with apache poi version 4.0.1 but after upgrading apache poi to the latest versions (version 4.1.2 or version 5.0.0) the xls file generated is corrupted and when i try to open it i cannot find any data inside. (the size of the xls file after upgrading the poi.jar was updated from 4KO to 0KO.)</p>
  <pre><code>import java.io.FileOutputStream;
  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  import org.apache.poi.ss.usermodel.Cell;
  import org.apache.poi.ss.usermodel.Row;
  import org.apache.poi.ss.usermodel.Sheet;
  import org.apache.poi.ss.usermodel.Workbook;
  
  public abstract class ExcelExporter
  { 
      public static void exportPanel(String account, JTable table) {
          FileOutputStream excel = null;
          try {   
              Workbook wb = new HSSFWorkbook();
              Sheet sh = wb.createSheet(&quot;hello&quot;);
              Row row = sh.createRow(0);
              Cell cell = row.createCell(0);
              cell.setCellValue(1);
              excel = new FileOutputStream(&quot;WORKBOOK.xls&quot;);
              wb.write(excel);
              wb.close();
              excel.flush();
              excel.close();
          } catch (Exception ex) {
              ex.printStackTrace();
          }   
      }
  }
  </code></pre>
  <p>Could you please advise?
  Thanks,</p>
  <p><a href="https://i.stack.imgur.com/R29pp.jpg" rel="nofollow noreferrer">enter image description here</a>
  <a href="https://i.stack.imgur.com/cbFec.jpg" rel="nofollow noreferrer">enter image description here</a></p>