我需要从工作簿中删除第一个工作表(工作表数量> 1)。POI错误在删除工作表后打开excel
这是我的代码:
inputStreamExcel = new FileInputStream(path);
wrkbook = new XSSFWorkbook(inputStreamExcel);
wrkbook .removeSheetAt(0);
outputStreamExcel = new FileOutputStream(path);
wrkbook.write(outputStreamExcel);
outputStreamExcel .flush();
outputStreamExcel .close();
我没有得到任何异常。 但是当我尝试打开Excel文件,我得到一个错误:
excel found unreadable content...
我认为它解决了它,我将在接受此答案之前运行更多测试场景。谢谢。 – yuris