How to Unprotect Excel Workbooks
Excel workbooks are an excellent tool for businesses and individuals to store and manage their data. However, sometimes, you may need to unprotect an Excel workbook to access or edit the data in it. Unprotecting an Excel workbook can be a tedious task, but it is straightforward if you know the steps to follow. In this article, we will show you how to unprotect Excel workbooks.
Method 1: Unprotect Excel Workbook with Password
If your Excel workbook is password protected, follow these steps to unprotect it:
Step 1: Open the Excel Workbook
Open the Excel workbook you want to unprotect.
Step 2: Enter the Password
Enter the password associated with the workbook to open it.
Step 3: Unprotect the Workbook
Once the workbook is open, go to the Review tab in the ribbon and select “Unprotect Workbook.”
Step 4: Enter the Password Again
Enter the workbook password once again to confirm the unprotection.
Method 2: Unprotect Excel Workbook with VBA Code
If your workbook is protected with a password and you do not know the password, you can use the VBA code to unprotect it. Follow these steps:
Step 1: Open the Excel Workbook
Open the Excel workbook you want to unprotect.
Step 2: Access the VBA Editor
Press “Alt + F11” to open the Visual Basic Editor.
Step 3: Insert the VBA Code
Once the VBA Editor is open, insert the below code in the code window:
Sub PasswordBreaker()
‘Breaks worksheet password protection.
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
On Error Resume Next
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If ActiveSheet.ProtectContents = False Then
MsgBox “Password is ” & Chr(i) & Chr(j) & _
Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub
Step 4: Run the Code
Press “F5” or click on the “Run” button to execute the code.
Step 5: See the Password
Once the code has done its job, it will display a message box with the password for the Excel workbook.
Step 6: Enter the Password
Use the password to unprotect the Excel workbook following the steps outlined in Method 1.
In conclusion, unprotecting Excel workbooks is necessary at times, and it is essential to know how to do it. With the above two methods, you can quickly unprotect an Excel workbook with or without a password. If you have forgotten the password, use the second method such that the VBA code will help you retrieve the password.