I am getting a "System.NullReferenceException: Object reference not set to an instance of an object." error when trying to load this specific Excel file (XmRChartPIR.xlsm). this excel template has a number of macros, buttons and charts.
I have been able to successfully load other files (.xlsm, .xlt, .xls) that are less complicated. Is there something I can do to load the Excel file I am having problems with?
Code:
Dim FileString As String = "...\Excel\XmRChartPIR.xlsm"
Dim exWB As New
Infragistics.Documents.Excel.Workbook()
exWB = Infragistics.Documents.Excel.Workbook.Load(FileString)
StackTrace:
NullReferenceException: Object reference not set to an instance of an object.]Infragistics.Documents.Excel.Serialization.Excel2007.SharedElements.Drawing.BlipElement.Load(Excel2007WorkbookSerializationManager manager, ExcelXmlElement element, String value, Boolean& isReaderOnNextNode) +539 Infragistics.Documents.Excel.Serialization.Excel2007.XmlElementBase.LoadChildElements(Excel2007WorkbookSerializationManager manager, ExcelXmlNode node, ExcelXmlDocument document, XmlReader reader, ElementDataCache elementCache, List`1 elementCacheCollection, BeforeLoadElementCallback beforeLoadElementHandler, AfterLoadElementCallback afterLoadElementHandler, Boolean& isReaderOnNextNode) +565 Infragistics.Documents.Excel.Serialization.Excel2007.XmlElementBase.LoadChildElements(Excel2007WorkbookSerializationManager manager, ExcelXmlNode node, ExcelXmlDocument document, XmlReader reader, ElementDataCache elementCache, List`1 elementCacheCollection, BeforeLoadElementCallback beforeLoadElementHandler, AfterLoadElementCallback afterLoadElementHandler, Boolean& isReaderOnNextNode) +632
"However, they should not be causing any a problem even if they are ignored."
I'm not sure I follow, what shouldn't be causing a problem?
The buttons and charts that are being stripped from the excel workbook are very important to the data that I am loading into one of the sheets. If infragistics can't return a sheet with the buttons and charts intact then the Export Excel feature is useless.
Previously, they were not supported at all. I believe some round-trip support was added for them recently, but if they are not being round-tripped in your file, that can be submitted as a bug so round-trip support can be extended for this scenario. However, they should not be causing any a problem even if they are ignored.
There are developer buttons placed in the worksheets to trigger events. I removed one of these buttons and was able to load and export data to the worksheet, but the sheet that opens up is stripped of ALL the remaining developer buttons on all the sheets.
Is there any known issues with buttons in excel?
Ok then it must be a new issue. The only way we can find and fix the issue is if we can reproduce it here. Having the file would help, but if you are unable to post it or send it to Developer Support, continue trying to remove things from it until it works again. When you get it working, try to add the last thing you removed to a new workbook and see if the same issue happens with that. If so, maybe that will be something you can send.
We are using 2011.2