Why close xml does not support .xls formated excel file?

17.5k Views Asked by At

During accessing ".xls" formated excel file using "closed xml" dll following exception is occurred

Exception : Excel may contain corrupted data...

3

There are 3 best solutions below

0
On

ClosedXML works with Excel 2007/2010 (OpenXML) files. XLS is older and very different Excel format and is not supported by ClosedXML.

Try to open your file with Excel, convert it to xlsx and then open it with ClosedXML.

0
On

ClosedXML uses the Open XML SDK under the hood which in turn only works with the newer Open XML file format (beginning with Excel 2007).

Therefor ClosedXML doesn't support the older format.

1
On

As stated by others, ClosedXML only works with the newer format.

NPOI works with older versions as well. If you use NPOI, make sure that you download the beta from their site. As of Dec 18, 2013 the NuGet download ONLY supports XLS. The beta supports XLS and XLSX