Extract mapped XML data from Excel sheet to XML file

Code
    SysExcelApplication application;
    
SysExcelWorkbooks   workbooks;
    
SysExcelWorkbook    workbook;
    
COM                 excelCOM;
    
object              xmlMaps;
    
object              xmlMap;
    
    
application SysExcelApplication::construct();
    
    if (!
application)
        throw 
error("@SYS105313");
    
    
workbooks application.workbooks();
    
    if (!
workbooks)
        throw 
error("@SYS105313");
    
    
application.displayAlerts(false);
    
    
workbooks.open(filenamefalse /*Update links*/true /*Read only*/);
    
workbook workbooks.item(1);
    
excelCOM workbook.comObject();
    
xmlMaps  excelCOM.xmlMaps();
    
xmlMap   xmlMaps.Item(1);
    
    
xmlMap.Export(filenameXml,true); // overwrite
    
workbooks.close();
    
application.quit();
    
application.displayAlerts(true);
AX versionMicrosoft Dynamics AX 2012
PropertiesCreated by Alex 2015-03-04 09:27:14 (Public)