Execute excel macro from dynamics axapta application //variable declaration SysExcelApplication xlsAppObj; SysExcelWorkbooks xlsWorkbooks; SysExcelWorkbook WorkBook; SysExcelWorksheet Worksheet; str fileName; ; xlsAppObj = SysExcelApplication::construct(); xlsAppObj.displayAlerts(true); xlsAppObj.visible(true); xlsAppObj.workbooks().open("SomeExcelFile.xls"); xlsWorkbook = xlsAppObj.workbooks().item(1); Worksheet = xlsWorkbook.worksheets().itemFromName("NameOfWorksheet"); //execute excel macro xlsAppObj.comObject().Run("XlsMacroName"); //Other excel related code is here //Filename fileName = "C:\\abc.xlsx"; //Check whether the document already exists if(WinApi::fileExists(fileName)) WinApi::deleteFile(fileName); //Save Excel document xlsWorkbook.saveAs(fileName); //Open Excel document xlsApplication.visible(true); //Close Excel ...
Microsoft Dynamics Ax,AIF,Axapta, Enterprise portal,,Microsoft , United State,U.S., SharePoint , BI Tools, Performance Tuning, SSRS,Business Logic,Ax ERP Errors and solution,Dynamics 365 Errors Solution,Business software .