We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel Engine failed to load workbook

Thread ID:

Created:

Updated:

Platform:

Replies:

117232 Sep 11,2014 06:50 PM UTC Sep 15,2014 11:43 AM UTC Silverlight 1
loading
Tags: XlsIO
David Ballard
Asked On September 11, 2014 06:50 PM UTC

I am opening and validation workbooks through an ASP.Net page that is called from a Silverlight application.  I am trying to open a workbook via a stream in C# code behind on the page and the error I get is:

"Destination array is not long enough to copy all the items in the collection. Check array index and length."

The code is C# and the stream is a System.IO.Stream:

            ExcelEngine EE = new ExcelEngine();
            
            IWorkbook ValWorkbook = EE.Excel.Workbooks.Open(CRStream, ExcelOpenType.Automatic);

The file size is 1.1MB and it is a Excel 2007 workbook.  The stack returned from the try/catch is:

   at System.BitConverter.ToInt16(Byte[] value, Int32 startIndex)
   at Syncfusion.XlsIO.Parser.Biff_Records.ByteArrayDataProvider.ReadInt16(Int32 iOffset)
   at Syncfusion.XlsIO.Implementation.Collections.RowStorage.SetFormulaValue(Int32 iColumn, Double value, StringRecord strRecord, Int32 iBlockSize)
   at Syncfusion.XlsIO.Implementation.Collections.RecordTable.SetFormulaValue(Int32 iRow, Int32 iColumn, Double value, StringRecord strRecord)
   at Syncfusion.XlsIO.Implementation.WorksheetImpl.SetFormulaValue(Int32 iRow, Int32 iColumn, Double value, StringRecord strRecord)
   at Syncfusion.XlsIO.Implementation.WorksheetImpl.SetFormulaValue(Int32 iRow, Int32 iColumn, Double value)
   at Syncfusion.XlsIO.Implementation.WorksheetImpl.SetFormulaNumberValue(Int32 iRow, Int32 iColumn, Double value)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.SetFormulaValue(IInternalWorksheet sheet, CellType cellType, String strValue, Int32 iRowIndex, Int32 iColumnIndex)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseCell(XmlReader reader, IInternalWorksheet sheet, List`1 arrStyles, Int32 rowIndex, Int32 columnIndex)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseRow(XmlReader reader, IInternalWorksheet sheet, List`1 arrStyles, String cellTag, Int32 generatedRowIndex)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseSheetData(XmlReader reader, IInternalWorksheet sheet, List`1 arrStyles, String cellTag)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseSheet(XmlReader reader, WorksheetImpl sheet, String strParentPath, MemoryStream& streamStart, MemoryStream& streamCF, List`1 arrStyles, Dictionary`2 dictItemsToRemove, Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseWorksheetData(WorksheetImpl sheet, Dictionary`2 dictUpdateSSTIndexes)
   at Syncfusion.XlsIO.Implementation.WorksheetImpl.ParseData(Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseWorksheets(Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseWorkbook(List`1& themeColors)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseDocument(List`1& themeColors)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseExcel2007Stream(Stream stream, String password)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseStream(Stream stream, String password, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options, ExcelVersion version)
   at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelVersion version)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelOpenType openType)
   at MSLC_IMCARS.Web.upload.ValidateCostReport(Stream CRStream, String CRFileName) in C:\IMCARS5\Development\MSLC_IMCARS_Apps\MSLC_IMCARS.Web\FileUploader.aspx.cs:line 408
   at MSLC_IMCARS.Web.upload.UploadButton_Click(Object sender, EventArgs e) in C:\IMCARS5\Development\MSLC_IMCARS_Apps\MSLC_IMCARS.Web\FileUploader.aspx.cs:line 99

This has been working for smaller workbooks.  Seems to choke at the System.BitConverter.  Is there a way to adjust the destination array?  Is this a setup I have to do when creating the Engine?  Is there a file size limitation?  Due to HIPAA regulations, I can't send the workbook.

Thank you.


Ishwarya Narayanan [Syncfusion]
Replied On September 15, 2014 11:43 AM UTC

Hi David,

 

We have tried in different scenarios and are unable to reproduce the issue. We suspect that the issue raises while applying certain formula. Kindly share us the simplified issue reproducing sample or the input template which helps us to investigate further on this.

 

We would request you to use our Direct-Trac Support system for further follow up.

 

Please let us know if you need any clarification.

 

Regards,

Ishwarya N


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;