surah79
asked on
EXCEL
HI Guys
Is there any way I can protect the Excel Workbook (Whole ) with a macro and and Unprotect it with a macro
Is there any way I can protect the Excel Workbook (Whole ) with a macro and and Unprotect it with a macro
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Public Sub unlocksheets()
'use it to unlock
On Error Resume Next
ActiveSheet.unprotect password:="ABC"
End Sub
Public Sub locksheet()
'to lock the sheet
On Error Resume Next
ActiveSheet.PROTECT password:="ABC"
End Sub