Free Support Forum - aspose.com

Exception when open Excel files

I am opening an excel file using the following code

Workbook excelObj = new Workbook();

excelObj.Open("Calculation.xls");

and I get an exception. Similar code works with Aspose.Excel before. The problem happens after we upgrade to Excel.Cells. Could you please help? Thanks.

The following is the details of the exception.

Index and count must refer to a location within the buffer. Parameter name: bytes

at System.Text.UnicodeEncoding.GetCharCount(Byte[] bytes, Int32 index, Int32 count)

at System.Text.Encoding.GetChars(Byte[] bytes, Int32 index, Int32 count)

at System.Text.Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)

at Aspose.Cells.Hyperlinks.೨(Byte[] ׀)

at Aspose.Cells.RW.࿆.࿵(ဈ Ԏ)

at Aspose.Cells.RW.࿆.࿶(ဈ Ԏ)

at Aspose.Cells.RW.࿆.ခ(ဈ Ԏ)

at Aspose.Cells.RW.࿆.ဇ(MemoryStream Ԏ)

at Aspose.Cells.RW.࿆.ဂ(๨ ဃ)

at Aspose.Cells.RW.࿆.ຕ(String Հ)

at Aspose.Cells.Workbook.Open(String fileName)

Could you please post your file here? Which version of Aspose.Cells are you using?

I have tried both 4.0.1.0 and 4.0.1.3. I think the problem is related to hyperlinks. Attached is a simple excel file that causes the problem. Thanks.

Yes, it’s a bug in loading UNC hyperlinks. I fixed it in this attached version. Please try it.

Thank you for your fix. The new dll works on some of my spread sheets, but I still get the exception on some others. Attached please find an example.

Please try this attached v4.0.1.5.

This one works fine so far. Thank you very much.