Openpyxl changing Display settings of PivotTable options
Created originally on Bitbucket by Sharma, Gunjan (Gunjan Sharma)
Hi,
I have been using openpyxl pretty recently. So far, everything is pretty amazing. I have been able to write to pre-formatted excels without any issues except this tiny thing now. So, post editing the excel (with a fairly simple piece as shown below), somehow the ‘Show the Values row’ option in Display tab of PivotTable options is getting enabled. I appreciate this is not a major issue but I just wanted to understand why/how this is happening.
I am using openpyxl version 2.6.2 and a .xlsx file
workbook_name=("test.xlsx")
wb = load_workbook(workbook_name)
ws1 = wb['data_table']
ws1.delete_rows(1, ws1.max_row)
for r in dataframe_to_rows(APR_Summary, index=False, header=True):
ws1.append(r)
wb.save("test.xlsx")wb.close()
Please direct me to the resolution if one already exists. I wasn’t able to find anything in the searches. Thanks for help in advance.
Attachments: Openpyxl_Pivot_Display