I'm new on the website. I try to write to an excel file while it is opened (using POI / JAVA).
I got a java.io.FileNotFoundException
error when i attempt to create a file output stream to write to the file.
FileOutputStream
didn't work. I receive this following message:
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();
}
Does anybody know how i can fix it? i'm writting an (POI-Java-Swing) application to dynamically read/write in excel files.
Thanks for your help