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

Free Support Forum - aspose.com

ExportXML using XML Map is throwing error

Hi,
The code is giving the below error in ExportXml method. However it works fine with the Export option available in the excel.

An unhandled exception of type ‘System.NullReferenceException’ occurred in Aspose.Cells.dll

Additional information: Object reference not set to an instance of an object.

var wb = new Workbook(@“C:\Sample.xlsx”);

//Access first Xml Map inside the Workbook
XmlMap xmap = wb.Worksheets.XmlMaps[0];

wb.ExportXml(xmap.Name, @“C:\Export.xml”);

Thanks,
Suresh

@bsuresh,

Thanks for the code segment and details.

Please provide your template file “Sample.xlsx”, we will check your issue soon.

PS. please zip the file prior attaching.