Free Support Forum - aspose.com

"System.ArgumentOutOfRangeException: Index was out of range" when opne an excel workbuck with images

"System.ArgumentOutOfRangeException: Index was out of range" when open an Excel Workbook with images.

Hello,

We have an uncontrolled exception when open an Excel workbook. Those are the details:

Aspose.Cells.dll Version: 5.3.3.3

Code Call:

Workbook m_excelWorkbook = new Workbook(templateName);<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

//TemplateName is the path of the file.

File example:

I had attached the file.

Stack trace:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: startIndex

at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)

at System.BitConverter.ToInt16(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 Aspose.Cells.Workbook.?(String ?, LoadOptions ?)

at Aspose.Cells.Workbook..ctor(String file)

Hi,

Please try the attached latest fix v5.3.3.6 (you may also try our upcoming version v6.0.0 that is scheduled to release today/tomorrow at sometime), it works fine with your file.

Thank you.

Thanks for the update.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We already tested it, we found the Exception previously thrown does not appear anymore but now when convert to pdf the images are not available.

Do you have a solution for this?

We used v6.0.0.

Please see attached file. This is the pdf generated by the file attached in my previous post.

Hi,

I tested your scenario (convert your template file to PDF) using your template file. I have found the issue as you have mentioned, the embedded objects in the sheet are not rendered fine in the generated PDF file. I have logged your issue with an id: CELLSNET-28508. We will fix your issue soon.

Thank you.

Hi,

Could you try the attached version v6.0.0.1, your issue should be fixed with it as I have tested a bit.

Thank you.