For your information, in the protected worksheet all the cells will have locked (Style.IsLocked) attribute on, so if you want a few cells in the range unlocked, you got to set those cells’ Style.IsLocked to “false”. See the complete document for your reference:
Alternatively, I think you may try to make use of Allow edit range(s) feature for your needs, see the document for your reference:
I need to apply style (false) to range. How to do this?
Style style; // Define the style object.
StyleFlag flag; // Define the styleflag object.
style = ??? //
style.IsLocked = false; // Lock it.
flag = new StyleFlag(); // Instantiate the flag.
flag.Locked = false; // Set the lock setting.
Good to know that the suggested code is helpful to you. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.