List-Data-Validation lost from source file
Created originally on Bitbucket by maurermaxnl (Max Maurer)
When plainly opening and saving a file containing a “Data-Validation” of type list and thus producing a nice dropdown in excel like explained here https://www.techrepublic.com/blog/microsoft-office/how-to-add-a-drop-down-list-to-an-excel-cell/
This cell setting is lost as soon as the file is saved again. (see attached input and output files)
The code used to generate the attached file
import openpyxl
wb = openpyxl.load_workbook(filename='DropdownTest.xlsx')
wb.save('output.xlsx')
Background
In our specific use case this is happening on a sheet in the workbook that we are not even touching/modifying (as above). To my current knowledge of the excel format I was wondering why the sheet is rewritten/modified at all if it not even touched by any modification.
Wouldn’t it be possible to not touch sheets that never receive a modification?
Attachments: DropdownTest_input.xlsxDropdownTest_output.xlsx