Free Support Forum -

Open Excel file 2003 without error using Aspose.Cells for .NET in C#

Aspose.Cells.Workbook _doc = new Aspose.Cells.Workbook();

_doc.Open(new MemoryStream(template.TemplateFile));

template.TemplateFile contains the byte[] of an excel file.

I get the following exception :

System.IO.EndOfStreamException: Impossible de lire au-delà de la fin du flux.
à System.IO.__Error.EndOfFile()
à System.IO.BinaryReader.FillBuffer(Int32 numBytes)
à System.IO.BinaryReader.ReadUInt16()
à x4974cb5652d7d108.xd686a7cfdb7bddb2..ctor(BinaryReader reader)
à x4974cb5652d7d108.xd8c3135513b9115b.x2f7b1d8f41a4e758()
à x4974cb5652d7d108.xd8c3135513b9115b.x5d95f5f98c940295(Stream xcf18e5243f8d5fd3)
à x4974cb5652d7d108.xd8c3135513b9115b..ctor(Stream stream)
à x2e38ab1759381034.x8b6071c5dcbbf539.x06b0e25aa6ad68a9(Stream xcf18e5243f8d5fd3)
à Aspose.Cells.Workbook.Open(Stream stream, FileFormatType type)
à Aspose.Cells.Workbook.Open(Stream stream)
à Triviumsoft.JobScheduler.AddIn.Report.ExcelEngine.ExcelEngine.BuildReport(IReportSettings report, TemplateConfiguration template, String culture, String connectionString)

I've attached the excel that give us problems.



Thank you for considering Aspose.

I tested your template file with the attached latest version of Aspose.Cells and found no issue. Please try the attached latest version and if you still face any problem, please share your sample code to reproduce the issue and we will check it soon. Following is my sample code:

Aspose.Cells.Workbook _doc = new Aspose.Cells.Workbook();

//Create a Stream object

FileStream fstream = new FileStream("C:\\Modele_R9.xls", FileMode.Open);

byte[] Data = new Byte[fstream.Length];

fstream.Read(Data, 0, Data.Length);

_doc.Open(new MemoryStream(Data));

Thank You & Best Regards,

Sorry that was related to a bug in our side.