I want to block the end user from setting a given style (more precisely, it’s setting any style other than font weight: bold/normal) while still being allowed to set under the hood via setStyle().
Can return false from the beforeAction and accomplish the blocking. But that would also block setStyle() for the same style and cell.
I saw both col and row are undefined for setStyle() which was promising, but that’s also the case if the end user happens to select the whole sheet.
If I pass a special fake style to indicate the programmatic source, that seems to be a workaround; even a JS Symbol works. But is there a better way?