How to unprotect the excel sheet if forgot the password

New Contributor

Hi team need support to unprotect my sheet which is password protected and forgot the password

 

69 Replies
Hi,

I am afraid the quick answer is you can't as to do so is to circumvent security.

So the best I can do is to say search for it via a search engine, but I can't condone any of the methods.

Thanks

Henry

Hello @vedangbapna   This really should be in the Excel community conversation so I'm going to move it there to increase your chances of getting a response.

@vedangbapna 

 

'CAUTION only to be used for your own Excel sheets!

 

 

Option Explicit

Sub GetPass()

    Const a = 65, b = 66, c = 32, d = 126

    Dim i#, j#, k#, l#, m#, n#, o#, p#, q#, r#, s#, t#

    With ActiveSheet

        If .ProtectContents Then

            On Error Resume Next

            For i = a To b

                For j = a To b

                    For k = a To b

                        For l = a To b

                            For m = a To b

                                For n = a To b

                                    For o = a To b

                                        For p = a To b

                                            For q = a To b

                                                For r = a To b

                                                    For s = a To b

                                                        For t = c To d

            .Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & _

            Chr(n) & Chr(o) & Chr(p) & Chr(q) & Chr(r) & Chr(s) & Chr(t)

                                                        Next t

                                                    Next s

                                                Next r

                                            Next q

                                        Next p

                                    Next o

                                Next n

                            Next m

                        Next l

                    Next k

                Next j

            Next i

            MsgBox "Finished"

        End If

    End With

End Sub

 

For any irresponsible action with this code, by any user, cannot and will not be responsible.

 

Nikolino

I know I don't know anything (Socrates)

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

* Beware of scammers posting fake support numbers here.

Hello,
This code doesn't seem to work for me. Apparently an expression is required before .Unprotect

Are you able to advise please?
ALT + F11
Double click on the workbook
Copy the code on the right
Press the play button (execute macro) and let it run.
Takes a little time depending on the length of the password.
but it sure works.

Cheers,
Nikolino
To my knowledge, there is no way to recover an Excel workbook / spreadsheet password without downloading third-party apps or add-ins, virtually none of which I would ever trust personally.

You can also try VBA code to remove your excel sheet password, but this method only works with single sheets. If you have multiple worksheets that need to be unlocked then you will have to run this code over and over again by opening each and every sheet manually.

Finally, if you want to crack the forgotten password to open Excel, there are many software you can choose like iseepassword Dr.Excel, docucrack or passcue for Excel.
https://www.iseepassword.com/open-a-password-protected-excel-file.html
https://www.ablebits.com/office-addins-blog/2016/02/10/protect-unprotect-excel-sheet-password/
https://www.passcue.com/unprotect-excel-worksheet-without-password.html
Did the instructions work?

If not send the workbook and with the same code I'll remove the password. It works 100%.
Don't forget to save the workbook with a different name at the end of the instructions and then run it again.
If you have any doubts, you can send an encrypted Excel file and I will send it back decrypted as a test.

I would be happy to know if I could help.

Nikolino
I know I don't know anything (Socrates)

 

If you are using Excel 2010 or older, you can unlock a sheet with a password with the following steps:

  1. Open your Excel document and switch to the password-protected sheet. You can do it by clicking on the file icon, it will open a list of options, select the info tab and click on the protect workbook.(it should be active when you run the code).
  2. Press Alt + F11 to open the Visual Basic Editor.
  3. Right-click the workbook name on the left pane (Project-VBAProject pane) and select Insert > Module from the context menu.
  4. In the window that appears, paste in the following code:

You can follow this website to no more: https://unboxstop.com/how-to-unprotect-excel-sheet-without-password/

@vedangbapna 

@Amarya_Williams 

The code is the same that I sent, just in a different sequence.

The instructions as well as the same.

I don't see any difference, not even in the approach.

Anyway, twice is maybe better.

 

Thanks for your additional help, hope we could help the user with it too.

 

Nikolino

I know I don't know anything (Socrates)

 

 

 

@vedangbapna   

Simple Solution for me ~ Forgot password worksheet (multiple worksheets in workbook)

Copy sheet into New Tab, Paste so looks exactly like sheet copied (password protect did not copy over to new sheet), double check matches data in prev sheet.  Delete original sheet and rename copied one same as original.  Password Protect this new sheet (if you wish) making sure you 'write it down' ; - )

Hope works for you!

I have a file that I would love for you to try and open for me. It's password protected worksheet. How can I send it to you to see if you an open it for me?
Send me the file and I will inform you about the possibilities.
This is a great solution, worked 100% thanks!

@NikolinoDE I have a file of one sheet that I would like to unlock, could you help me with that please?

@NikolinoDE 

 

Hi Nikolino, I can see you have been able to assist with Excel Spreadsheets with forgotten unprotect passwords. I have the same issue as I created a spreadsheet months ago, have not looked at it since and I've now forgotten the password. Would you be able to assist with recovering the password?

 

Thanks in advance

 

Jim

@Jimbo2904 

Help for self-help

 

For some worksheets it can take a whole day, sometimes more.

But in the end, I was able to decipher all worksheets 99% of the time.

 

If it is a matter of removing (not retrieving) a Worksheet password, the following code may be used:

In a common Module we paste the following code that removes the code from the activated sheet:

Code:

'CAUTION!! Recommended only for proprietary Excel sheets!

Option Explicit
Sub GetPass()
    Const a = 65, b = 66, c = 32, d = 126
    Dim i#, j#, k#, l#, m#, n#, o#, p#, q#, r#, s#, t#
    With ActiveSheet
        If .ProtectContents Then
            On Error Resume Next
            For i = a To b
                For j = a To b
                    For k = a To b
                        For l = a To b
                            For m = a To b
                                For n = a To b
                                    For o = a To b
                                        For p = a To b
                                            For q = a To b
                                                For r = a To b
                                                    For s = a To b
                                                        For t = c To d
            .Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & _
            Chr(n) & Chr(o) & Chr(p) & Chr(q) & Chr(r) & Chr(s) & Chr(t)
                                                        Next t
                                                    Next s
                                                Next r
                                            Next q
                                        Next p
                                    Next o
                                Next n
                            Next m
                        Next l
                    Next k
                Next j
            Next i
            MsgBox "Finished"
        End If
    End With
End Sub

The time it will take depends to a large extent on the power of the computer.

 

Nikolino

 

I'm surprised no one has suggested removing the password via XML. Code isn't needed.

@Patrick2788    Could you elaborate?

@vedangbapna 

This approach still works although I haven't tested it recently.

 

Save the workbook under a new name but use Save as Type "Excel 97-2003"

 

That operation in your new workbook will have lost all features used by Excel versions after Excel 2003.

 

You then need access to a computer running a version of Excel before Excel 2016 and preferably as early as 2007.

 

Open your file on the computer running the old version of Excel.

 

Open also the file I attach to this post. That file can run on later versions of Excel but doesn't work on Excel 365, or Excel 2019, or 2016. I think it might work with a bit of a 'glitch' on 2013. It does work on 2012 and before.

 

I wrote an explanatory document on including the code used this in Word and I attach that for your assistance.

 

You can also copy the allinternalpasswords VBA code I wrote in 2002 from:

McGimpsey & Associates : Excel : Remove internal XL passwords

 

That code will find a password that opens any number of hidden sheets or protected structure.

 

The disadvantage is that you lose all features from later versions of Excel but you will generally, at least, have back access to all your data and that, indeed, might well be your lifesaver.

 

Old versions of Excel are still available on Ebay etc. But they really need installing on a computer without any later versions of Excel on it or using a Virtual machine approach.

 

Hope that helps. Sorry I haven't tested it as I don't have access to an ancient version of Excel at present and don't run a Virtual Machine.

 

Norman Harker