Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: Loading SSRS Excel spreadsheet throws Object reference not set error

$
0
0
I'm loading the xlsx excel spreadsheet that was created from a SSRS report built using Sql Server Data Tools of Sql Server 2012. Has this happened to anyone else?

In this line:
XLWorkbook workbook = new XLWorkbook("TestReport.xlsx");

I get the following error.
System.NullReferenceException: Object reference not set to an instance of an object.
at ClosedXML.Excel.XLWorkbook.LoadCells(SharedStringItem[] sharedStrings, Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, Dictionary2 sharedFormulasR1C1, XLWorksheet ws, Dictionary2 styleList, Cell cell, Int32 rowIndex)
at ClosedXML.Excel.XLWorkbook.LoadRows(Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, XLWorksheet ws, SharedStringItem[] sharedStrings, Dictionary2 sharedFormulasR1C1, Dictionary2 styleList, Row row)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook.Load(String file)
at ClosedXML.Excel.XLWorkbook..ctor(String file, XLEventTracking eventTracking)
at ClosedXML.Excel.XLWorkbook..ctor(String file)

Viewing all articles
Browse latest Browse all 1877

Trending Articles