openpyxl icon indicating copy to clipboard operation
openpyxl copied to clipboard

Add custom ContentTypeProperties properties to Excel workbook

Open kalekje opened this issue 2 years ago • 0 comments

With VBA, I can edit arbitrary workbook metadata like so, and it will be reflected on SharePoint:

With ThisWorkbook
        .ContentTypeProperties("Property A") = 1
        .ContentTypeProperties("Prop B") = “Something”
End With

Now, I am hoping to do the same with openpyxl

I can do this for properties without spaces:

wb.properties.title = 'test'

but properties with spaces won't work--I try this and the script runs, but nothing shows on SharePoint:

setattr(wb.properties, 'Project Title', 'hello')
wb.properties.__dict__['Project Number'] =  '12'

kalekje avatar Jul 08 '22 13:07 kalekje