我是网站上的新手.我尝试在打开excel文件时写入(使用POI / JAVA).
当我尝试创建文件输出流以写入文件时,我收到了java.io.FileNotFoundException错误.
FileOutputStream不起作用.我收到以下消息:
the process cannot access the file because it is being used by another
process.
try {
FileOutputStream fileOut;
XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream("Classeur.xlsm"));
...
...
fileOut = new FileOutputStream("Classeur.xlsm");
wb.write(fileOut);
fileOut.close();
}
catch (FileNotFoundException e){
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
有谁知道我怎么解决它?我正在写一个(POI-Java-Swing)应用程序来动态读/写excel文件.
谢谢你的帮助