I have been struggling to get some basic functionality using OpenXML sdk so am trying out ClosedXML.
I am trying to open a new workbook from a stream.
However I get this error : There isn't a worksheet named '#REF'.
Here's the code snippet:
Stream stream = librariesManager.Download(doc);
byte bytesInStream = new byte[stream.Length];
using(MemoryStream fStream = new MemoryStream())
stream.Read(bytesInStream, 0, bytesInStream.Length);
fStream.Write(bytesInStream, 0, bytesInStream.Length);
// Rewind ready for reading (typical scenario)
fStream.Position = 0;
var w = new XLWorkbook(stream);
var wb = new XLWorkbook(fStream);
if I try the "stream" object, I get an error that the stream doesn't support seek.
On using the MemoryStream object, I get the error mentioned above.
I was able to open and read the file by creating a SpreadSheetDocument object and parse it. So I guess, the file is valid.