As you mentioned, the error that you are facing could be because of the difference in the datatype of the cell contents. If the value that you are trying to SET is of string type, you are currently not surrounding that value with single or double quotes. Hence, if you determine the value you are trying to update is of string type, you can create the query in such a way that the value is enclosed with single or double quotes.
Also to troubleshoot, you can set break points and see what the actual query is, before calling the "exec" command, and make sure that the query is syntactically correct. I hope this helps!