We help IT Professionals succeed at work.

EXCEL

surah79
surah79 asked
on
HI Guys

Is there any way I can protect the Excel Workbook (Whole ) with a macro and and Unprotect it with a macro
Comment
Watch Question

Check the link below. It does what you want to happen.

http://www.ozgrid.com/forum/showthread.php?t=36816

Sincerely,
Ed

Commented:
please try following macros.


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

Explore More ContentExplore courses, solutions, and other research materials related to this topic.