title: Getting error when editing Excel file using Apache POI
body: <p>I am trying to edit an excel file which contains data using Apache POI. 
  I have written the below code:</p>
  
  <pre><code>    FileInputStream fileInputStream = new FileInputStream(new File("file.xlsx"));
      Workbook workbook = WorkbookFactory.create(fileInputStream);
      Sheet sheet = workbook.getSheet("sheet");
  
      Row row = sheet.getRow(1);
      Cell cell = (row.getCell(1) == null) ? row.createCell(1) : row.getCell(1);
      cell.setCellType(CellType.STRING);
      cell.setCellValue("something here");.
      fileInputStream.close();
  
      try(FileOutputStream fileOut = new FileOutputStream("file.xlsx")) {
          workbook.write(fileOut);
          workbook.close();
      }
  </code></pre>
  
  <p>When I run the code, I get the following error when I try to open the Excel file: "We found a problem with some content in 'file.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes."</p>
  
  <p>If I click on yes,the Excel does get updated with the values that I have specified; however, I do not want this error to appear. How can I solve this? </p>