Why not just have the protection turned off while the macro runs and the last line of code turns it back on


Sub pwd
ActiveSheet.UnProtect Password:="Password"

"your code"

ActiveSheet.Protect Password:="Password"

end sub
'Something like that...