I am working on some project where I use NPOI library for reading some data from excel. Everything was working good but then I tried to read .xls and it stopped working. (Everything was well for .xlsx).
The last thing i tried is this:
IWorkbook hssfwb;
using (FileStream file = new FileStream(@filePath, FileMode.Open, FileAccess.Read))
{
hssfwb = WorkbookFactory.Create(file);
}
The exception I get is:
Your stream was neither an OLE2 stream, nor an OOXML stream.
What I need is a way to open .xls files using NPOI library. Thanks in advance.