How to unprotect the excel sheet if forgot the password

Copper Contributor

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

 

304 Replies

@NikolinoDE  did not work for me. nothing at all happened when I pressed alt + f11

@nikilinoDE

I have the pleasure to work with NikolinoDE, outstanding professionalism, extremely knowledgeable, great in explaining the process, risk and the best pushforward with what we need to accomplish. He's attention to details is refreshing and I recommend him for a successful outcome on your particular project.
Anthony

@Eviee1265 

I get a similar compilation error.... I appreciate Nikolino's efforts to help us, AND his assurance that the code MUST work... maybe with some assistance how to avoid/overcome the compilation error message?

Tjwan_Oei_0-1695548174048.png

 

I already have found some clue.... the line, starting with .Unprotect is divided over two lines.. I have deleted some spaces between "&" and "ctrl (n)" and now a process is running...

I am waiting for the results

Tjwan

@NikolinoDE 

Thanks man. 

This code solved mine. 

Simply remove the password and set a new one. 

Cheers!!!

@NikolinoDE 

Sir I have a excel file i have tried but unable to do this and file is so important for us

I request please decrypte it and send back on my mail     email address removed for privacy reasons   https://docs.google.com/spreadsheets/d/1sYEdkyRTysWxOrE2qMxQagXHN7HBYhcE/edit?usp=sharing&ouid=10336... 

Great! This worked pretty well for me; thank you,  @Norman_Harker 

Save as Excel 97-2003

Then open that file. Protect it

Save as xlsx again

 

Password protect removed..

 

 

Save as Excel 97-2003
Then open that file. Protect it
Save as xlsx again
Password protect removed..

@NikolinoDE 

where do I input the code and how do make it run?

 

@fcruz1974 

 

Save as Excel 97-2003
Then open that file. Protect it
Save as xlsx again
Password protect removed..

@Derek2475

 

This did not work for me.  

Any other suggestions?

 

Thanks in advance…

It's maybe version dependant then. I use 365

You can choice catpasswd.com recovery password platform, it's very fast and hight success rate @vedangbapna 

Have you tried the VBA method?

@AMIT7007 

 

Could send me the file and I'll remove it for you if you wish? 

where i insert these code

@NikolinoDE Fantastic work! Thnaks. For those having erros, move the line together so it reads

.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)

 

Originally it was split to two lines and was causing an error for me

@Meseret 

To insert and run the provided VBA code in Excel, follow these steps:

  1. Open Excel: Launch Microsoft Excel and open the workbook you want to unprotect.
  2. Enable Developer Tab: If you don't see the "Developer" tab on the Excel ribbon, you need to enable it:
    • Go to "File" > "Options."
    • In the Excel Options window, select "Customize Ribbon."
    • Check the "Developer" option in the right-hand panel.
    • Click "OK."
  3. Access the VBA Editor:
    • Click on the "Developer" tab.
    • Click on the "Visual Basic" button. This will open the VBA Editor.
  4. Insert Code:
    • In the VBA Editor, locate the worksheet where you want to unprotect.
    • Right-click on that worksheet in the Project Explorer (on the left side).
    • Choose "Insert" > "Module." This will insert a new code module.
    • Paste your VBA code into the module.

VBA Code:

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
  1. Run the Code:
    • Close the VBA Editor.
    • You can run the code in several ways:
      • Press F5 while the VBA Editor is open with the code window selected.
      • Go back to your Excel workbook.
      • Press Alt + F8 to open the "Macro" dialog.
      • Select "GetPass" from the list.
      • Click "Run."

This VBA code is designed to brute-force the password for a protected worksheet. It attempts various combinations of characters to unprotect the sheet. When a successful password is found, it will display a message with the password.

Please note that using this code to crack a password may be against your organization's policies or even illegal in some jurisdictions. Ensure you have the appropriate permissions before using this code.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

 

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

 

@NikolinoDE 

 

I opened my excel workbook, then Visual Basic.  Where do I then paste the code you provided? 

 

Thanks in advance for being so helpful.

 

 - Randy