title: Java Apache poi cannot delete folder containing Excel files and cannot delete sheets in Excel files
body: <p>I am trying to write a program with apache poi in Java that should edit some Excel files.</p>
  
  <p>I am running into the following problem: the folder which contains my Excel file seems to have been locked after having run the program. If I try to delete it, it says I need to get permission from the administrator. I do not get this message with any other folders in the same location, nor with folders inside this folder. I am the administrator on this computer, as it is my private laptop.</p>
  
  <p>The second problem I have is that after I run the program, I am thereafter unable to delete sheets that it created. I have to manually save the Excel file, close it, reopen it, and then I can delete sheets again.</p>
  
  <p>Thanks in advance.</p>