Have you ever encountered a locked Excel file and struggled to find a way to access it without the password? Well, worry not, as we will provide you with the steps to do so in this article. But first, let’s understand why Excel locks files with a password and how it affects users.

Why does Excel Lock Files with a Password?

Excel provides users with the option to protect their spreadsheets by adding a password to it. This feature is available for both Windows and Mac versions of Excel. Password protection ensures that only authorized persons can access or modify the document. This is important, especially when confidential information or valuable data is involved.

Protection can be provided in two ways:

  • Protecting Workbook Structure: This option prevents others from viewing or modifying the structure of the workbook, such as adding or deleting sheets.
  • Protecting a Worksheet: This option prevents others from editing, deleting or adding data on a sheet. The sheet remains static and unmodifiable.

Now, let’s move on to the main topic of this article. Here are the steps to unlock a password-protected Excel file.

How to Unlock a Password-Protected Excel File?

Sometimes, we forget our passwords or don’t have access to them, but still need to access locked Excel files. In such cases, we can unlock Excel files either by using a third-party software or through some built-in features in Excel. Here are the steps to unlock a password-protected Excel file through Excel’s built-in features:

Method 1: Using Excel’s Open Feature

This method works when the file is password-protected for opening only, and you don’t need to make changes to it. Here’s how you can do it:

  1. Open Excel and go to the File tab.
  2. Click on Open and browse for the password-protected file.
  3. You will see a prompt asking for the password to access the file. Leave it blank and click OK. If the file is only protected for viewing, it will open instantly.
  4. If the file is protected for editing too, you will see another prompt asking for the password. Since you don’t have access to it, click on Cancel.
  5. The file will now open as a read-only file. You can view or copy information from it, but you can’t edit or save changes to the original file unless you have the password.

Method 2: Using VBA Code

This method might seem complicated for non-technical users, but it is useful when the file is password-protected for editing and opening. Here are the steps:

  1. Open the password-protected file.
  2. Press Alt+F11 to open the Visual Basic Editor.
  3. Click on Insert and select Module. A new module window will open.
  4. Copy and paste the following code into the module 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 "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
  1. Press F5 or click on the Run Macro button to run the code. It will take time depending on the complexity of the password.
  2. Once the password is found, a message box will appear with the password.
  3. Use the password to unlock the sheet or workbook.

These two methods are helpful when you forget your passwords and need quick access to your file. But we recommend that you protect your Excel files with strong passwords and take precautions to keep them safe.


Q1. Can I use the above methods to unlock a password-protected Excel file on a Mac?

A1. Yes, you can use both methods on a Mac as well. The process remains the same for both Windows and Mac users.

Q2. Will Excel notify the owner if someone tries to unlock their password-protected files?

A2. No, Excel doesn’t have any built-in function to notify the owner when someone tries to unlock their password-protected files.


Password protection is an essential feature in Excel to prevent unauthorized access to confidential data. However, users may forget their passwords or lose access to them, which can be problematic. The two methods discussed in this article can help users quickly access their locked Excel files, but they should always try to protect their files with strong passwords. We hope you found this article useful and informative.

Video Tutorial: How to Unlock Password-Protected Excel File?

If you prefer a video tutorial, here is one for you: