The following code fails to keep the VBA macro when opening and writing data to an excel 2010 xlsm file.
w_book = load_workbook( filename=os.path.join(out_dir, file_dir_name + ".xlsm"), keep_vba=True) # Add data to worksheet here w_book.save(os.path.join(out_dir, file_name + ".xlsm"))
This works fine however in 2.3.5.
I've attached a test script and macro file. Note that you will have to change 2 path variables at the top of the script.
Also I'm using Python 3.4.3.