To repo, open an xlsm file, execute the function RemoveMacro(), save the file as an xlsx and try reopening the Excel file.
@julianbenjamin,
Please share your sample file and code snippet with us for our testing. We will reproduce the problem and provide our feedback after analysis.