ActiveX button not working when saving .xlsm file with openpyxl

Viewed 292

I have a .xlsm file containing a macro which is activated with an ActiveX button. When I save the file with openpyxl, and open it again, the ActiveX button has been converted to a picture. The macro is still there, but the button cannot activate the macro. Here follows my code:

wb = openpyxl.load_workbook(file_dir, read_only = False, keep_vba=True)
wb.save(file_dir)

ActiveX button before and after .xlsm file is saved

How do I keep the functionality of the ActiveX button?

0 Answers
Related