This project has moved. For the latest updates, please go here.

File In Use When Trying To Create a New ExcelPackage

Feb 2, 2015 at 1:10 PM
Edited Feb 2, 2015 at 1:10 PM
After I use the Ajax asyncfileupload tool to grab my user's file I save it to a directory on the webserver via the fileupload.saveas method. Then I use your sample code to open a file and create an ExcelPackage to read the contents and it always says the file is in use.

Here are the two lines that get it started and it fails on the using statement.

FileInfo existingFile = new FileInfo(file);
    using (ExcelPackage package = new ExcelPackage(existingFile))
    {
        ...mycode
     }
I'm always told the existingFile is in use. Why? When i use the ExcelDataReader project found here on CodePlex it works fine when opening and reading but your project always fails.

I want to use your project for reading as well as writing but only the writing works.

Has anyone else run into this and have a solution?