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.