I am currently writing a program that outputs to a excel file. (the same open it reads) I have a feeling that the users will open the file in excel before modifying in my application. While I do realize I could save a new file that is not as neat.
I am looking for a way to unlock the file from Excel or force the write of the file, can you please help?
I need to end up with a way of the file to be open in Excel and still be able to write to the file from java.
Thank you!
Edit:
To answer the question why I would want to unlock the file, well the program I am working on does not have a excel viewer built in, only the ability to update based on standardized input.
So the users will still be viewing the file in excel. If they need to open this program first that would be alright also.
I guess another option is how to open the file with write access while Excel can still read it?
Currently when opening I am using Apache POI HSSF/XSSF, once my program opens the file, if i try to open it in excel i get the following error: "Excel cannot open the file because the file format is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.