I have seen this error when trying to change a cell's format (e.g. setting the NumberFormat property) on a worksheet that is protected with none of the protection options Format cells, Format columns, or Format rows set and user-interface-only protection not set. A solution is to use user-interface-only protection, which can be very useful and save a lot of programming effort when used properly, but it requires an understanding of its quirks and limitations. (See Chip Pearson's page: http://www.cpearson.com/excel/Protection.aspx.)

It is likely that the 400 error will pop up when attempting to change other cell properties under those conditions but I haven't done any extensive verification of that.