The status of UserInterfaceOnly:=TRUE , unfortunately, is not saved in the file, so if you open the file again, it will be completely protected. Either use the Workbook_Open event to reapply this protection status, or cancel protection, and then immediately reprogram the worksheet in your VBA code.
See Ozgrid for more details!
Peter Albert
source share