Free Support Forum - aspose.com

Receiving "Object reference not set to an instance of an object." on LoadData()

Hi,

We have a program which is failing on the LoadData() call for a subset of our files (roughly 10%).
I've set up a test application which consists, literally, of :

try
{
Console.Write("opening workbook...");
Workbook wkbk = new Workbook();
wkbk.LoadData("broken_excel.xls");
Console.WriteLine("done");
}catch (Exception e)
{
Console.WriteLine("\n\ncaught: " + e.Message);
Console.WriteLine("\n\n\tat:" + e.StackTrace);
}
Console.ReadKey();


The exception is the following:

Object reference not set to an instance of an object.
at xe185e525bc4a50a8.x4c60c9e2927f2d75.xb1e2c9a68308ad60(Cell xe6de5e5fa2d44af5, Int32 x6c4cefefce057c94)
at x2e38ab1759381034.xbf9def61fff46310.x7ef4021f9c97d571(x508b33aea0611cd1 xcf18e5243f8d5fd3)
at x2e38ab1759381034.xbf9def61fff46310.xbddc206c7dafc24d(x508b33aea0611cd1 xcf18e5243f8d5fd3)
at x2e38ab1759381034.xbf9def61fff46310.x2a9806f9bb2936af(x508b33aea0611cd1 xcf18e5243f8d5fd3)
at x2e38ab1759381034.xbf9def61fff46310.x6b024d3b2b8f9765(MemoryStream xcf18e5243f8d5fd3)
at x2e38ab1759381034.xbf9def61fff46310.x6f3d999f7a817f2d(xd8c3135513b9115b x84378c276c4cd7e2)
at Aspose.Cells.Workbook.LoadData(String fileName, LoadDataOption option)
at Aspose.Cells.Workbook.LoadData(String fileName)
at AsposeTest.Program.Main(String[] args) in C:\Documents and Settings\dschobe\Desktop\AsposeTest\AsposeTest\Program.cs:line 19



The peculiar thing is that 100% of the models open correctly in Excel.

This is using Apose 4.9.0.0

What do you suggest?

Hi,

Please share your template file (causing the problem) with us to reproduce the issue. We will check it and figure out the issue soon.

Thank You & Best Regards,

Hi Nausherwan,


Thanks for the quick response. Please find the file attached.

Daniel

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

Thank you for sharing your template file.

I tested your issue with the attached latest version of Aspose.Cells and it works fine. Please try the attached latest version and if you still face any problem, please create a sample application to reproduce the issue and post it here. Also, please provide us the details about your system requirements like OS, VS.NET version etc. We will check it soon.

Thank You & Best Regards,

That works like a charm, thanks for your help.



Daniel