Forum Discussion

RuthDelbert's avatar
RuthDelbert
Copper Contributor
Jul 02, 2024

How to unprotect Excel sheet if forgot the password

I recently encountered a problem and hope to get your help. I set a protection password for an Excel file before. Now I want to modify some data, but I found that I forgot Excel password. I wonder if there is any way to remove the protection or unprotect Excel sheet password? If anyone knows a related solution or has had a similar experience, please share it, thank you very much!

 

This file is very important to me, and there is a lot of work data in it. I have tried some methods found on the Internet, but none of them worked. It would be great if someone could provide some specific steps or recommend some tools.

66 Replies

  • Chikstew's avatar
    Chikstew
    Copper Contributor
    Using VBA code to unprotect Excel sheet password is essentially a hack. It's like using a skeleton key to break into a safe. If you're working on sensitive data or files, you might want to think twice about using this method, as it could compromise the security of your work.
  • TommieCorwinbe's avatar
    TommieCorwinbe
    Copper Contributor

    RuthDelbert 

    I have also been in a situation where I forgot Excel password of an Excel file. At that time, I used a simple VBA script to try to unprotect Excel worksheet. The basic steps are as follows:

     

    1. Open the Excel file: First, open the file you need to unlock.
    2. Launch the VBA Editor: Press Alt + F11 keys in Excel, which will open the VBA Editor.
    3. Insert a new module: In the VBA Editor, right-click on "VBAProject" on the left, select "Insert", and then select "Module".
    4. Copy and paste the code: Paste a VBA code for cracking the password in the new module. This code will try various password combinations until it finds the correct password.

     

    5. This code will try some simple passwords (such as "1234", "password", "0000") and tell you which one is the correct password. Of course, you may need to try more combinations in actual use.

     

    6. Run the script: In the VBA editor, press F5 to run the script. If the password is simple, this method may successfully unlock it.

     

    This method is more suitable for situations where the password is not particularly complex. If the password is very complex, it may take more time or a more complex script to try. I hope this simplified method can help you!

  • TommieCorwinbe's avatar
    TommieCorwinbe
    Copper Contributor

    RuthDelbert

    Using VBA to try to unprotect Excel sheet without password is a more technical method, but if you are willing to try some programming, it is definitely a direction to explore. I once encountered the problem of forgetting the password of an Excel file, and a piece of VBA code helped me solve this trouble.

     

    It is actually not that complicated to operate. You just need to open the Excel file with password protection and press Alt + F11 to enter the VBA editor. Here, you can insert a new module and paste a piece of code to crack the password. There are many such sample codes on the Internet, but the basic idea is to try multiple combinations until you find the correct password.

     

    Here is a simple VBA code example to try to unlock Excel worksheet:

     

    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

    This code will try various password combinations and if it finds the right password it will display it. Of course, this method may take some time, especially if the password is complex.

     

  • ToddSumrall's avatar
    ToddSumrall
    Iron Contributor

    RuthDelbert For Excel 2007 and later versions, files are saved in an XML-based format. This means you can unzip the file and manually edit the XML files to remove the protection. This method requires some technical knowledge and careful handling of XML files.

     

    How to unprotect Excel sheet without password by editing the internal xml file:

     

    1. Change the file extension of the Excel workbook from .xlsx to .zip.
    2. Extract the contents of the ZIP file to a folder.
    3. Navigate to the folder and open the xl subfolder.
    4. Locate the worksheets subfolder and find the XML file corresponding to the protected sheet (e.g., sheet1.xml).
    5. Open the XML file in a text editor (e.g., Notepad++).
    6. Search for the tag <sheetProtection> and delete it along with its attributes.
    7. Save the XML file and close the text editor.
    8. Compress the folder back into a ZIP file.
    9. Change the file extension from .zip back to .xlsx.
    10. Open the modified Excel file, and the sheet should be unprotected.
    • rhinotek1's avatar
      rhinotek1
      Copper Contributor

      Thank you for the steps.  This had worked for me before but if renaming the file from .XLSX to .ZIP gives you an error (unsupported format), rename it to .ARJ, and the same can be done using the BBEdit app.  Simply open the ARJ file with BBEdit and follow the rest of the steps.

       

      • rhinotek1's avatar
        rhinotek1
        Copper Contributor

        Thank you EnricoPenco! I had posted a similar solution where I mentioned to change the file extension to ARJ.  But after reading your post, the same can be done with the standard XLSX extension. So, let me reiterate myself:

        THIS IS EXCEL FOR MAC OS USERS.

        1. Download a FREE copy of BBEdit
        2. Make a copy of your password protected file: Select it, press CMD-C then CMD-V.
        3. Right-Click on the new file and select "Open With" then "Other..."
        4. On the pop-up window, next to "Enable:", change "Recommended" to "All Applications".
        5. Make sure NOT TO ENABLE "Always Open With".  
        6. Select "BBEdit.app" your list of Applications. 
        7. BBEdit will show a series of locations on the left pane.  Expand "xl", and within it expand "worksheets".
        8. Select the "sheet" with the password.
        9. You can use the function to Find (CMD-F) to easily locate "<sheetProtection"
        10. Delete this tag from "<sheetProtection" to its tag closure "/>"
        11. Save the file and open it to make sure password is gone.

         

    • god_akshay's avatar
      god_akshay
      Copper Contributor
      very nice and simple execution, no external software nothing pure action! thanks buddy!
      • rhinotek1's avatar
        rhinotek1
        Copper Contributor

        If Unsupported Format error see my solution above.

  • I actually ran into the same issue before. I ended up using a tool called Dr--Excel, and it worked like a charm. It took me just over 20 minutes to recover my 7-digit password, and I was back into my file without any issues.

     

    I followed this step-by-step guide:

    https://www.makeuserof.com/unprotect-excel-sheet

     

    The interface is straightforward, and it’s easy to use.  If you’re stuck like I was, I’d definitely recommend giving Dr--Excel a try.

    • cpisani's avatar
      cpisani
      Copper Contributor

      Is this a safe product?  Will the contents of my spreadsheet be shared or saved anywhere else but on my laptop?

    • rhinotek1's avatar
      rhinotek1
      Copper Contributor

      This may be a scam but the manual steps are easy to follow and work on any device/OS

  • BethWhisler's avatar
    BethWhisler
    Copper Contributor

    There are several online services that offer password recovery tools for Excel. These tools can quickly unprotect excel sheet without password. Be cautious when using online services and ensure they are reputable to avoid data breaches or malware.

     

    Search for a reliable online Excel password recovery tool. Upload the protected Excel file to the service. Follow the instructions provided by the service to remove or recover the password. Download the unprotected file once the process is complete.

Resources