How to Unprotect Excel Workbooks

Don't get locked out!

Microsoft Excel is an electronic spreadsheet with multiple functions and features that allow you to do calculations, create graphic representations of your data, keep your data organized and protect it when needed. One such feature of Excel is the ability to protect your Excel files at the cell, spreadsheet, and/or workbook level, but sometimes it's necessary to unprotect Excel workbooks to ensure data changes apply correctly.

This article provides steps on how to unprotect a protected Excel spreadsheet in Microsoft Excel 365, as well as Microsoft Excel 2019, 2016, and 2013.

How to Unlock an Excel Spreadsheet as the Owner of the File

This method assumes that as the owner of the file, you remember the password used to protect the spreadsheet.

  1. Open the protected spreadsheet, and select Review > Unprotect Sheet. You could also right-click the protected spreadsheet, then select Unprotect Sheet.

    You can identify a protected spreadsheet under the Changes section of the Review tab on the ribbon. If the spreadsheet is protected, you see the Unprotect Sheet option.

    The Review tab and Unprotect Sheet button
  2. Enter the password used to protect the spreadsheet, then select OK.

    Password prompt
  3. Your spreadsheet will now be unprotected and it can be modified.

    Protect Sheet

How to Unprotect an Excel Workbook Without Knowing the Password

You may have protected your Excel workbook or spreadsheet and haven't had to modify it in some time, even years. Now that you need to make changes, you no longer remember the password you used to protect this spreadsheet.

Fortunately, these steps will allow you to unprotect your workbook using a Virtual Basic script as a macro to identify the password.

  1. Open the protected spreadsheet.

  2. Access the Visual Basic code editor by either pressing ALT+F11 or select Developer > View Code.

    The Developer tab and View Code command
  3. In the Code window of the protected sheet, enter the following code:

    Sub PasswordBreaker()
    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 "One usable 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
  4. Select Run or press F5 to execute the code.

  5. The code will take several minutes to run. Once finished, you'll receive a pop-up with a password. Select OK and your spreadsheet will be unprotected.

    This is not the original password and you don't need to remember it.

Was this page helpful?