Epplus not reading excel file

In the date of this post EPPLUS (v4.4.1) seems to handle xls files just like it does with xlsx:

Here is an example:

  using (var target = new ExcelPackage(new System.IO.FileInfo("D:\\target.xls")))
        {
            target.Workbook.Worksheets.Add("worksheet");
            target.Workbook.Worksheets.Last().Cells["A1:A12"].Value = "Hi";
            target.Save();
        }

also tested your code:

FileInfo newFile = new FileInfo("C:\\Excel\\SampleStockTakeExceptionReport.xls");
ExcelPackage pck = new ExcelPackage(newFile);
var ws = pck.Workbook.Worksheets.Add("Content");
ws.View.ShowGridLines = false;
ws.Cells["J12"].Value = "Test Write";
pck.Save();
System.Diagnostics.Process.Start("C:\\Excel\\SampleStockTakeExceptionReport.xls");

and it works without any issues.


Epplus does not handle .xls (BIFF8 format) files as far as i know.

It handles the newer .xlsx (Open Office Xml) format.

You can use excellibrary though as it works for xls files.