Error message: A sequência não permite a leitura.

Error message: A sequência não permite a leitura.


I am trying to use this C# code ( as an extension (.xif). The library works fine using VS, although when I use it as an extension I get the following error and stack trace:

A sequência não permite a leitura.

em System.IO.BinaryReader..ctor(Stream input, Encoding encoding)
em ExcelLibrary.CompoundDocumentFormat.CompoundDocument..ctor(Stream stream, FileHeader header)
em ExcelLibrary.CompoundDocumentFormat.CompoundDocument.Open(Stream stream)
em ExcelLibrary.CompoundDocumentFormat.CompoundDocument.Read(Stream stream)
em ExcelLibrary.SpreadSheet.Workbook.Load(Stream fileStream)
em ExcelLibrary.SpreadSheet.Workbook.Load(String file)
em OutSystems.NssexcelIntegration.CssexcelIntegration.MssWorkBook_Open(String ssFilePath, Object& ssWorkBook)
em ssApplication.RssExtensionexcelIntegration.MssWorkBook_Open2(HeContext heContext, String inParamFilePath, Object& outParamWorkBook)

Does anyone can help me?

Regards, André Passos.
Hi André,

That error message is translated to "Stream was not readable.". It would appear that it is a common error, but happens in many different situations. Searching in Google was pretty inconclusive.

Are you accessing the file in the right path? Do you have permissions to read it? What's your operating system?

Also, in VS, if you try to read a file that does NOT exist, what error does it return? Is it the same?


Paulo Tavares