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

No Worksheets found

Jan 9, 2015 at 9:46 AM
Edited Jan 9, 2015 at 12:28 PM
EDIT : After further investigation, the problem was not EPPlus related. My apologies for wasting your time.


I am currently facing a weird issue while trying to manipulate an Excel file with EPPlus.
I have a file that I was provided which I managed to succesfully access and read. However, when I open this file with Excel on my computer and then save it, EPPlus does not find Worksheets in the document anymore.

Here is how I manipulate the file :
public static void ImportFile(string filePath) {
            var existingFile = new FileInfo(filePath);

            using (var package = new ExcelPackage(existingFile)) {
                ExcelWorkbook workBook = package.Workbook;
                if (workBook != null) {
                    if (workBook.Worksheets.Count > 0) {
                        ExcelWorksheet currentWorksheet = workBook.Worksheets.First();


The if statement is successful when I import the file untouched (workBook.Worksheets.Count = 2) and I can manipulate the data.
After opening the Excel file and saving it again without touching data, workBook.Worksheets.Count = 0 which prevents me going further.

I am working on Windows 7 64bit, using the version of EPPlus and the Office365 version of Excel 2013.

If someone has already faced a similar problem, any help would be much appreciated.

Nicolas F
Jan 9, 2015 at 12:25 PM
My bad, the problem was located before trying to read the file. My uploader did not save the file properly which caused the emply worksheet list when reading a non existing file.

This topic can therefore be closed.

Nicolas F
Marked as answer by NicolasSyselio on 1/9/2015 at 4:25 AM