Aspose.Cells "Object reference not set to an instance of an object." when opening a XLS


#1

I got the error below when trying to open a file. The project and file are attached.

Error message: Object reference not set to an instance of an object.
StackTrace:
at . ( )
at . ( )
at . ( )
at .(MemoryStream )
at .( )
at Aspose.Cells.Workbook.(String , LoadOptions )
at Aspose.Cells.Workbook…ctor(String file, LoadOptions loadOptions)
at AsposeTest5.Program.Main(String[] args) in C:\Users\bjuliao\source\repos\AsposeTest\AsposeTest5\Program.cs:line 13

AsposeTest5.zip (121.9 KB)


#2

@brunojuliao,

I have opened the XLS file in Excel 2016 where it shows error before opening. It seems to be some issue with the file, that is why Aspose.Cells is raising exception. Please share a file which opens fine in Excel without any error but raises exception when opened by Aspose.Cells. We will look into this issue and provide our feedback.

ErrorInExcel.PNG (4.2 KB)


#3

Well noticed. I have more files (attached) but they all display the same pop warning that data may be lost. After that, it opens the file without issues (regarding data, layout and etc).

Error Files.zip (356.1 KB)


#4

@brunojuliao,

We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46216 - Exception Object reference not set to an instance of an object while loading XLS file

As a workaround, if you do not use “LoadFilter = new LoadFilter(LoadDataFilterOptions.CellData)”, there is no exception.


#5

Awesome! Take your time. I appreciate very much all the support provided.


#6

@brunojuliao,

This is to inform you that the problem has been fixed (previously recorded as “CELLSNET-46216”). After performing QA and adding other extensions and fixes, we will provide fixed version.


#7

@brunojuliao

Thanks for using Aspose APIs.

Please download and try the following fix and let us know your feedback.


#8

The issues you have found earlier (filed as CELLSNET-46216) have been fixed in Aspose.Cells for .NET v18.7. Please also check the document/article for your reference: https://docs.aspose.com/display/cellsnet/Installation