VB macro is lost in openpyxl 2.4.0
Created originally on Bitbucket by fozzy5 (Hugh Foster)
The following code fails to keep the VBA macro when opening and writing data to an excel 2010 xlsm file.
#!python
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.
Attachments: report_template.xlsmxl_test.py