This one bites a lot of people because the drop-down arrow appears, so the file looks validated when it isn't. Setting showErrorMessage=True (and errorStyle='stop') fixes typing, but it's worth knowing that pasting a value into the cell still bypasses data validation in Excel entirely, so anything downstream should re-check values when reading the file back. Another gotcha: an inline list in formula1 is capped at 255 characters, so longer option lists should point to a range on a (possibly hidden) sheet instead. A quick round-trip test that loads the saved file and asserts dv.showErrorMessage is True makes a nice regression check.
Writing about AI agents, hardware, and practical software.
Thank you, Yunus, this is a very useful addition. On the paste point: LibreOffice Calc's own help says the validity rule does not take effect for values inserted by copy and paste or by drag and drop, and the same page points to Tools - Detective - Mark Invalid Data to show cells that already hold invalid values. So re-checking the values when the file is read back, as you suggest, is a sound habit, and a round-trip test on showErrorMessage is a neat way to catch the default.
Yunus Emre Vurgun
This one bites a lot of people because the drop-down arrow appears, so the file looks validated when it isn't. Setting showErrorMessage=True (and errorStyle='stop') fixes typing, but it's worth knowing that pasting a value into the cell still bypasses data validation in Excel entirely, so anything downstream should re-check values when reading the file back. Another gotcha: an inline list in formula1 is capped at 255 characters, so longer option lists should point to a range on a (possibly hidden) sheet instead. A quick round-trip test that loads the saved file and asserts dv.showErrorMessage is True makes a nice regression check.