Excel中创build的文件Excel无法通过Ms Excel打开(文件损坏)

我不知道为什么使用POI编写的文件无法由Ms Excel打开,但是文件仍然可以被POI读取。 (单元格值可以更改)我使用Apache-Poi 3.10 Final和JDK 1.5

链接文件: http : //www.corteconti.it/export/sites/portalecdc/_documenti/controllo/sez_autonomie/2016/schemi_di_bilancio_armonizzato_2015_ens_art_1_delibera_12_2016_sezaut_inpr.xls

这里是代码

String nomeFileArt1 = "schemi_di_bilancio_armonizzato_2015_ens_art_1_delibera_12_2016_sezaut_inpr.xls"; NPOIFSFileSystem fs = new NPOIFSFileSystem(new File(System.getProperty("java.io.tmpdir") + nomeFileArt1)); HSSFWorkbook wb = new HSSFWorkbook(fs.getRoot(), true); FileOutputStream stream = new FileOutputStream(System.getProperty("java.io.tmpdir") + "schemi_di_bilancio_armonizzato.xls"); HSSFSheet sheet = wb.getSheet("Dati_Anagrafici"); HSSFRow sheetrow = sheet.getRow(10); if (sheetrow == null) { sheetrow = sheet.createRow(10); } HSSFCell cell = sheetrow.getCell(0); if (cell == null) { cell = sheetrow.createCell(0); cell.setCellType(HSSFCell.CELL_TYPE_STRING); } cell.setCellValue("test"); wb.write(stream); stream.close();