Save XLSM with Macro

After I open a xlsm file and save as new xlsm, it would disable macro when I open it using office excel.
Here is my codes:
Workbook workbook = new Workbook(“C:\Users\z_jia\Desktop\a\a.xlsm”);

workbook.save(“C:\Users\z_jia\Desktop\a\b.xlsm”);

the error:
72cee4509edc8d5ad1a15912786cdd8.png (11.9 KB)

@GusGus,

Please zip and attach your input XLSM file here. We will check your issue soon.

a.zip (217.3 KB)

@GusGus,

Thanks for the template XLSM file.

After initial testing, I am able to reproduce the issue as you mentioned. I found by re-saving XLSM file with macros disable macros.

We require through evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-46159

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@GusGus
If we enable macro of a.xlsm, close Excel, then open a.xlsm again, we got same error.

It seems that there is corrupted VBA project in the original file.
You can remove it with codes:
workbook.RemoveMacro();