title: Write XLSX file to external storage in Android
body: <p>I'm trying to create and save an XLSX file into my <strong>Download</strong> folder, but even if it doesn't gives error, nothing gets saved. This is the code:</p>
  
  <pre><code>private void importIntoExcel() throws IOException {
      String[] columns = { "Numero Test", "Genere", "Data di nascita", "Data del test"};
  
      Workbook workbook = new XSSFWorkbook();
      Sheet sheet = workbook.createSheet("RiepilogoTest");
  
      Font headerFont = workbook.createFont();
      headerFont.setBold(true);
      headerFont.setFontHeightInPoints((short) 14);
      headerFont.setColor(IndexedColors.RED.getIndex());
  
      CellStyle headerCellStyle = workbook.createCellStyle();
      headerCellStyle.setFont(headerFont);
  
      // Create a Row
      Row headerRow = sheet.createRow(0);
  
      for (int i = 0; i &lt; columns.length; i++) {
          Cell cell = headerRow.createCell(i);
          cell.setCellValue(columns[i]);
          cell.setCellStyle(headerCellStyle);
      }
  
      // Create Other rows and cells with contacts data
      int rowNum = 1;
  
      // Write the output to a file
      FileOutputStream fileOut = new FileOutputStream(new File(Environment.getExternalStorageDirectory().toString()+"risultatiTest.xlsx"));
      workbook.write(fileOut);
      fileOut.close();
  }
  </code></pre>