Jeffrey Mahoney
Well-known Member
- Joined
- May 31, 2015
- Messages
- 2,787
- Office Version
- 365
- Platform
- Windows
I use the userInterfaceOnly option all the time with sheet protection. It works really well without having to unprotect the sheet, run code and re-protect. The only problem is that I have to protect the sheets with this method every time the workbook is opened. That's ok if I have a smaller number of sheets that need that. With a few hundred sheets, at startup, it starts taking over a minute to protect all the sheets.
Is there a way to permanently set the protection with the userInterfaceOnly option even when the file is closed?
Jeff
Is there a way to permanently set the protection with the userInterfaceOnly option even when the file is closed?
Jeff
Code:
With sht '.EnableOutlining = True
.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True, _
AllowFormattingCells:=False, AllowFormattingColumns:=False, _
AllowFormattingRows:=False, AllowInsertingHyperlinks:=False, AllowFiltering:=False, _
userInterfaceOnly:=True, Password:="sn"
End With
Last edited: