Prevent blank entry into listbox cell

I want to prevent users from leaving a blank cell in a listbox. I’m using the EditCell method to edit the cell which works fine. In the CellAction event I have the following code:

if trim(me.cell(row,column)) = “” then
me.cell(row,column) = OriginalCellValue // OriginalCellValue is a property set by the CellGotFocus event
MsgBox “Cell cannot be left blank”
end if

All works fine apart from the last line which doesn’t appear to execute. Have also tried this in the CellLostFocus event but no difference. I’ve also tried listbox.setfocus after the MsgBox as well as a host of other attempts but nothing seems to work.

Does anyone have any ideas as to why this doesn’t work?
Mac OSX El Capitan

Sometimes calling certain methods from certain events does not work. You could try calling EditCell from a timer.

Thanks, I’ll try that and see if it works

That did the trick. Thanks for your help