I did another test, with the worksheet protected and I verified this: before protecting it all the codes work regularly; after activating the protection, the error message appears. And, even if I open the VBA and clear the bug and remove the protection, the code does not work (even if the error message no longer appears). So, I close and restart excel and then, the worksheet (unprotected) works fine again. Perhaps, besides the protection that maybe should be fixed with a code, there is some addin that creates problems to my excel (2016 - 365)...