JXL Api在阅读MS Excel 2013生成的Excel文件时抛出错误

时间:2014-07-23 09:49:03

标签: java excel jxl

我有一个通过MS Excel 2013创建的“test.xlsx”文件。当我尝试通过JXL API阅读时,如下所示

public Workbook readExcel(File inputWorkbook) {
        Workbook workbook= null;
        try {
            workbook = Workbook.getWorkbook(inputWorkbook);
            Sheet sheet = workbook.getSheet(0);
            for (int j = 0; j < sheet.getColumns(); j++) {
                for (int i = 0; i < sheet.getRows(); i++) {
                    Cell cell = sheet.getCell(j, i);
                    CellType type = cell.getType();
                    if (type == CellType.LABEL) {
                        System.out.println("I got a label "
                                + cell.getContents());
                    }

                    if (type == CellType.NUMBER) {
                        System.out.println("I got a number "
                                + cell.getContents());
                    }

                }
            }
        } catch (BiffException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return workbook ;
    }

我收到“ jxl.read.biff.BiffException:无法识别OLE流” 当我将此文件保存为1997-2003 .xls时,程序运行正常。

我想知道JXL api是否有限制,它无法读取MS 2013 Excel程序?

如果someOne解决了这个问题,请告诉我

0 个答案:

没有答案