File Excel From Apache POI Cant Open by Ms Excel (corrupt)

后端 未结 5 603
囚心锁ツ
囚心锁ツ 2020-12-19 01:56

I don\'t know why the file I write using POI cant be opened by Ms Excel 2013, but the file is still readable by POI. (cell value can be changed)

this is the error fr

5条回答
  •  伪装坚强ぢ
    2020-12-19 02:23

    The major problem that i see here is:

    Workbook workbook = null;
        workbook = new HSSFWorkbook(fis);
    

    Instead you have to use:

    Workbook workbook = null;
        workbook = new XSSFWorkbook(fis);
    

    TO be readable by MS EXCEL 2013.

提交回复
热议问题