在java中读取和编写包含宏的XLSM电子表格

时间:2018-01-22 04:50:01

标签: java

我在阅读java中的XLSM电子表格excel文件时遇到异常

org.apache.poi.POIXMLException:org.apache.poi.openxml4j.exceptions.InvalidFormatException:包应包含内容类型部分[M1.13]

    //My Code Look like
         String source="test.xlsm";
        File file = new File("D:\\file\\"+source);
        FileOutputStream fileOut = new FileOutputStream(file,false);
        FileInputStream fin = new FileInputStream(file);
        if(file.exists()){
          **Workbook workbook = new XSSFWorkbook(fin); // While Reading time i am getting exception here**
          XSSFSheet sheet = (XSSFSheet) workbook.getSheetAt(1);
        }

0 个答案:

没有答案