xiaofengzai

Unable to recognize OLE stream 的解决方法

将xlsx用excel打开并另存为2003的xls,然后再运行即可解决问题

File file = new File("E:\\work.xls");
        Workbook workbook = Workbook.getWorkbook(file);
        //2:获取第一个工作表sheet
        Sheet sheet = workbook.getSheet(0);
        for (int i = 0; i < sheet.getRows(); i++) {
            Stu bean = null;
            String name="";
            String num="";
            for (int j = 0; j < sheet.getColumns(); j++) {
                Cell cell = sheet.getCell(j, i);
                bean = new Stu();
                if (j == 1)
                    name = cell.getContents();
                if (j == 4)
                    num = cell.getContents();
            }
            map.put(name,num);
        }
        //最后一步:关闭资源
        workbook.close();

 

分类:

技术点:

相关文章:

  • 2021-11-27
  • 2021-10-21
  • 2021-09-15
  • 2021-10-30
  • 2021-08-20
  • 2021-06-22
  • 2022-01-16
  • 2022-02-24
猜你喜欢
  • 2021-05-15
  • 2022-01-02
  • 2021-12-10
  • 2022-02-24
  • 2021-09-29
  • 2021-07-22
  • 2022-03-05
相关资源
相似解决方案