title: In java how can I unlock a file or write to a file opened by excel
body: <p>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.</p>
  
  <p><strong>I am looking for a way to unlock the file from Excel or force the write of the file, can you please help?</strong></p>
  
  <p>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.</p>
  
  <p>Thank you!</p>
  
  <p>Edit:</p>
  
  <p>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.</p>
  
  <p>So the users will still be viewing the file in excel.
  If they need to open this program first that would be alright also.</p>
  
  <p>I guess another option is how to open the file with write access while Excel can still read it?</p>
  
  <p>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.</p>