We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exception with message "Object reference not set to an instance of an object."

Conversion of one of the file failed while converting excel file to PDF. We are using Aspose.Cells(Ver. 7.1.1.0). Following is the exception we got. Please provide fix asap.

Code snippet:
Workbook workbook=null;
workbook = new Workbook(sourceFilePath);
Aspose.Cells.SaveOptions saveOptions = null;
saveOptions = new Aspose.Cells.XlsSaveOptions();
saveOptions.CachedFileFolder = Path.GetTempPath();
saveOptions.SaveFormat = Aspose.Cells.SaveFormat.Pdf;
if (workbook != null)
workbook.Save(destinationFilePath, saveOptions);

Exception:

3/10/2012 6:50:21 AM
Message: HandlingInstanceID: 069baf80-b961-4741-8cd6-83abe5d90dfd
An exception of type 'System.NullReferenceException' occurred and was caught.
2012-03-10 01:50:21Z
System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Object reference not set to an instance of an object.
Aspose.Cells in file: C:\Windows\TEMP\IntraLinks\ff182e3f-1b1d-485e-9167-34067f391463.xls
System.Collections.ListDictionaryInternal
Void (’.„)
at ’.Œ.(„ )
at ’.Œ.Ž(„ )
at ’.Œ.(„ )
at ’.Œ.(MemoryStream )
at ’.Œ.( )
at Aspose.Cells.Workbook.(String , LoadOptions )
at Intralinks.Common.Utilities.AsposeConverter.ConvertXlsToPdf(String sourceFilePath, String destinationFilePath) in c:\ilbuilds\pdfconv\build_trunk\CommonUtilities\AsposeConverter.cs:line 75
at Intralinks.Common.Utilities.CommonUtilities.ConvertOfficeDocsToPDF(String sourceFile, String destinationFolder, Boolean useOriginalFileName) in c:\ilbuilds\pdfconv\build_trunk\CommonUtilities\CommonUtilities.cs:line 1464
Category: Logging Exception
Priority: 1
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: WDPPF01
Application Domain: ILPDFConversionService.exe
Process Id: 2056
Process Name: C:\PDFConvService\WOODDALE.pdfconv\instance1\Release\ILPDFConversionService.exe
Win32 Thread Id: 4920
Thread Name:
Extended Properties: Product Version - 3.1.27217.0

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

1/18/2012 4:52:05 AM
Message: HandlingInstanceID: 860fe622-4bd8-45ea-bda9-a6fdad0381b8
An exception of type 'System.NullReferenceException' occurred and was caught.
2012-01-17 23:52:05Z
System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Object reference not set to an instance of an object.
Aspose.Cells in file: C:\WINDOWS\TEMP\IntraLinks\8a9d31c4-a579-4469-a1a5-1406784594bc.xls
System.Collections.ListDictionaryInternal
Void x533dee58d7fff4e6()
at x484486ddc8e52eef.x54ec3bed6813979e.x533dee58d7fff4e6()
at x484486ddc8e52eef.x54ec3bed6813979e.x06b0e25aa6ad68a9(xfc686d5bce097028 x1f31bf6ca58166a1, Worksheet x99ecbc7e3ae0e29b, x8b6071c5dcbbf539 x3b41448adea64309)
at x484486ddc8e52eef.xd6c068b9dc379245.x35db41d5b3184c65()
at x484486ddc8e52eef.xd6c068b9dc379245.x06b0e25aa6ad68a9(WorksheetCollection x6d7b41a5fb54bb38, Worksheet x99ecbc7e3ae0e29b, x8b6071c5dcbbf539 xe134235b3526fa75, x508b33aea0611cd1 xcf18e5243f8d5fd3)
at x2e38ab1759381034.x8b6071c5dcbbf539.xbddc206c7dafc24d(x508b33aea0611cd1 xcf18e5243f8d5fd3)
at x2e38ab1759381034.x8b6071c5dcbbf539.x2a9806f9bb2936af(x508b33aea0611cd1 xcf18e5243f8d5fd3)
at x2e38ab1759381034.x8b6071c5dcbbf539.x6b024d3b2b8f9765(MemoryStream xcf18e5243f8d5fd3)
at x2e38ab1759381034.x8b6071c5dcbbf539.x6f3d999f7a817f2d(xd8c3135513b9115b x84378c276c4cd7e2)
at Aspose.Cells.Workbook.Open(Stream stream, FileFormatType type)
at Aspose.Cells.Workbook.Open(String fileName)
at Intralinks.Common.Utilities.AsposeConverter.ConvertXlsToPdf(String sourceFilePath, String destinationFilePath) in c:\ilbuilds\pdfconv\build_trunk\CommonUtilities\AsposeConverter.cs:line 71
at Intralinks.Common.Utilities.CommonUtilities.ConvertOfficeDocsToPDF(String sourceFile, String destinationFolder, Boolean useOriginalFileName) in c:\ilbuilds\pdfconv\build_trunk\CommonUtilities\CommonUtilities.cs:line 1385
Category: Logging Exception
Priority: 1
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: WDPDPF01
Application Domain: ILPDFConversionService.exe
Process Id: 6308
Process Name: C:\PDFConvService\WOODDALE.pdfconv\instance1\Release\ILPDFConversionService.exe
Win32 Thread Id: 4020
Thread Name:
Extended Properties: Product Version - 3.0.24944.0

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please download and use the latest version:
Aspose.Cells
for .NET v7.1.2.1

it should fix the problems.

If the problem still occurs, then please provide us your xls/xlsx file which you are converting to pdf.

We will check it soon and help you asap.