This project has moved and is read-only. For the latest updates, please go here.

EPPlus: Created file is locked

Nov 20, 2013 at 6:28 PM
Edited Nov 20, 2013 at 6:28 PM
I create an Excel file using EPPlus library. After the file is created, it cannot be deleted or edited, as it is said to be used by "another user", as long as the program is running. I cannot find any solution that would work for me.
Here is my code:

        var newFile = new FileInfo(path); 
        using (var xlPackage = new ExcelPackage(newFile))
        {
            var ws = xlPackage.Workbook.Worksheets.Add("Sheet1");
...
            xlPackage.Save();
        }
The strange thing is that I am able File.Delete() the newly created files from within my code. But I cannot delete or edit it while the program is still running from the Windows Explorer.