You can upload an XLSM. I have used XLSM templates in the ExcelExporter module before. Once a user clicks the export button that template is used to populate the data into this template with macro. After downloading the user can still trigger the macro via Excel to do any manipulations you didn’t want to have coded in Mendix.
But I assume that is not your actual question and you would like to either transform this macro logic into Mendix logic or let Mendix run the macro instead of the user. The first is a no. This can’t be automatically done. You would need to translate the macro logic into Mendix logic yourself. The second I looked into, but the Apache POI which Mendix uses to manipulate and generate Excel documents, isn’t capable of running macro’s. So there also a no..