Hi
recently I get NullReferenceExceptions when our program tries to call AutoFitRow
Stacktrace is
at ᑍ.᪠.(String و, FontStyle ᒢ, String )
at ㌙.䔀.䔰(ArrayList 䒥, Workbook ִ, String 䔱)
at ֩.䑁.䑄(Cell ݔ, Int32 ℾ, Int32 ഹ)
at ֩.䑁.䑈(Graphics ⃕, Cells य, Int32 Դ, Int32 Զ, Int32 Ե, Int32 Է, AutoFitterOptions ٖ)
at ֩.䑁.䑂(Cells य, Int32 Դ, Int32 Զ, Int32 Ե, Int32 Է, AutoFitterOptions ٖ)
at Aspose.Cells.Worksheet.AutoFitRow(Int32 rowIndex)
I’m not sure when it started but it still worked some time ago and I don’t have that issue on other computers with similar os and spec.
I’m running windows 8.1 64bit and visual studio 2013 with Aspose.Words 10.5.0 (so it hasn’t changed over some years)
Not sure if some .NET update killed it or something else. I hope you can give me some hint as you know what happens in the method where the exception is thrown.
BR
TK
Hi Torsten,
Thank you for contacting Aspose support.
Unfortunately we will not be able to properly investigate the problem cause on our end unless you provide us the spreadsheet that is triggering the problem. In case you are creating the workbook on the fly then please share a runnable sample application replicating the issue.
The stack trace shared by you shows that you are using Aspose.Cells API in your application but you have mentioned a version of Aspose.Words, therefore we are not aware of your current version of Aspose.Cells API. If you can, please give a try to our latest version of Aspose.Cells for .NET 7.7.1.3 to see if the latest build makes any difference. Please note, we have tested the latest build by calling the Worksheet.AutoFitRow method on a loaded workbook as well as on the one created dynamically.
Hi
sorry for posting the version of words.
Cells we are using is version 7.0.2.0
I did a small test with this code
Workbook workbook = new Workbook();where I get the exception. Using the latest cells version 7.7.1 it is working.
workbook.Worksheets[0].Cells[0, 0].Value = “Test”;
workbook.Worksheets[0].AutoFitRow(0);
I saw in another thread version 7.0.2.7 should fix the issue however not for me.
So it seems we need an update.
Thanks for your help.
BR
TK
Hi Torsten,
Good to know that your issue got resolved with latest version of the API. While upgrading to the latest version, please consider checking the expiry of your subscription. You may load the license file in the notepad to find the tag. If the subscription expiry date is before the release date of Aspose.Cells for .NET 7.7.1 then you have to renew your subscription as well in order to use the latest version of the API in licensed mode.
Please feel free to write back in case you need our further assistance.