Openpyxl does not read/write workbook custom document properties
Created originally on Bitbucket by smuhit (Sabbir Muhit)
My Environment: MacOS High Sierra (10.13.3) Microsoft Excel for Mac version 16.11 Python 3.6.2 openpyxl 2.5.0
When using openpyxl to open a workbook with custom properties as shown here, saving that workbook loses those custom properties.
Example script:
#!python
import openpyxl
wb = openpyxl.load_workbook('test.xlsm', keep_vba=True)
wb.save('test2.xlsm')
An example of such a workbook is attached (it has the custom property of "Foo" set to "Bar"). It also has a basic macro (bound to Commad+Option+z) to set the active cell's value to the value of the custom "Foo" property (in this case "Bar"). While the macro works in the original workbook, it doesn't in the cloned workbook because those custom properties are missing.
I also looked through openpyxl's documentation (and the source code) to see if I could read custom properties, and I didn't find anything relevant.
Attachments: test.xlsm