Free Support Forum - aspose.com

Opening Workbook Causes Exception

Hello,

We are having a problem opening a particular Excel file. We get the following exception:

at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.BitConverter.ToInt16(Byte[] value, Int32 startIndex)
at System.BitConverter.ToUInt16(Byte[] value, Int32 startIndex)
at ჯ.䉃.䉌(Byte[] 䉍, Int32 Ӥ)
at ჯ.䉃.䉔(Shape ๊, Byte[] 䉕)
at ჯ.䉃.䉖(Int32& 䉗, Shape ๊, Byte[] 䉘, Int32 Ӥ, Byte[] 䉕)
at ჯ.䉃.㚆(Byte[] 䉈, Int32 Ӥ, MsoDrawingType 䉉)
at ჯ.䉃.䉇()
at ༞.䆛.䇕(䈃 Ԡ)
at ༞.䆛.䇴(䈃 Ԡ)
at ༞.䆛.䇷(MemoryStream Ԡ)
at ༞.䆛.䇵(࣊ ר)
at ༞.䆛.ः(࣊ ר)
at Aspose.Cells.Workbook.ԝ(String Ԟ, LoadOptions ԟ)
at Aspose.Cells.Workbook…ctor(String file)

Not sure what is causing this, the file can be opened in Excel itself without difficulty. I have attached a Visual Studio 2010 sample project to illustrate the problem.

Hi,


Thank you for your project.
We are able to reproduce the said exception with latest fix version of Aspose.Cells for .NET v5.3.3.4. So we have logged it in our Bug Tracking System under Ticket ID CELLSNET-28221. We will keep you posted on this.

Hi,

We have fixed this issue. Please download Aspose.Cells for .NET v5.3.3.5.

Well that fixed the issue for that particular file. Unfortunately it lead to another one with a different file. Find a sample project attached.

Hi,

Thanks for sharing the project with sample code.
I can still find the IndexOutOfRange exception opening your template file by Aspose.Cells API. I have re-opened your issue and we will fix it soon.

Thank you.

Hi ,

There are some error in the template file. MS Excel could not open the file too.

Could you share with us how to create such file? We will check it soon.

The issues you have found earlier (filed as 28221) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,

I am having this same issue

Type: IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Stack Trace: at ?.?.?()
at ?.?.?()
at ?.?.?(MemoryStream ?)
at ?.?.?(? ?, Worksheet ?, ? ?)
at ?.?.?()
at ?.?.?(WorksheetCollection ?, Worksheet ?, ? ?, ? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?(MemoryStream ?)
at ?.?.?(? ?)
at ?.?.?(Stream ?)
at Aspose.Cells.Workbook.Open(Stream stream, FileFormatType type)
at Aspose.Cells.Workbook.Open(Stream stream)
at Clarity.FSR.Office.ExcelWrapper.GetWorkbookFromMemory(String binaryString) in C:\FSR\FSR 6\Branches\6.6.1\Source\Clarity.FSR.Office\ExcelWrapper.cs:line 831

Here is the sample code and excel file you can use to reproduce this:

[Test]
public void Aspose_Excel_IndexOutOfRangeException_Test()
{
const string excelFile = @“C:\Users\mpatel\Desktop\FSR Test Workbooks\Excel_Crash.xls”;

var wb = new Workbook(excelFile);
}

I am able to open this file fine in excel 2007.




Hi,


Please try the attached latest version v6.0.1.5. I have tested your code with your template file, it works fine.

Thank you.