Question
Excel xlsx Saveas .xlsm
I have a Automation process that opens an Excel XLSX file using the Excel Connector and then Modifies The Columns and Data and Then embeds a Macro to the Excel document using a C# Script process. But when I pass the filename with the extension .XLSM to the SaveAS process in the automation Excel Object I get a Popup Saying "The Following Features cannot be saved in a macro-free Workbook
.VBProject
To save this file with these features , Click No, and then Select a Macro-Enabled File Type
The Path / File name I'm passing to the SaveAS process ends in .XLSM
How can I open an Excel .XLSX and Modify to include Macros and then save as an .XLSM without prompting the User?
The Excel connector doesn't offer the needed parm for the Saveas. I ended up using a process in the script to preform this task.
SaveAs(System.IO.Path.GetFileName(ExcelInputFile.Replace("xlsx", "xlsm")), Excel.XlFileFormat.xlOpenXMLWorkbookMacroEnabled,null, null, false, false, Excel.XlSaveAsAccessMode.xlNoChange, false, false, null, null, null);