Protect workbook
Sub ProtectWorkbook() Dim wb As Workbook Set wb = ThisWorkbook wb.Protect "Excel2003", True, True 'wb.Unprotect End Sub