how to unprotect excel sheet
How to unprotect Excel sheet without password
Unlock Excel spreadsheet with VBA code (for Excel 2010 and lower)
If you are using Excel 2010 or older version, you can unlock a password-protected sheet with the following macro.
- Press Alt + F11 to open the Visual Basic Editor.
- Right-click the workbook name on the left pane (Project-VBAProject pane) and select Insert > Module from the context menu.
- In the window that appears, paste in below code.
SubPasswordBreaker()'Breaks worksheet password protection.DimiAsInteger, jAsInteger, kAsIntegerDimlAsInteger, mAsInteger, nAsIntegerDimi1AsInteger, i2AsInteger, i3AsIntegerDimi4AsInteger, i5AsInteger, i6AsIntegerOnErrorResumeNextFori = 65To66:Forj = 65To66:Fork = 65To66Forl = 65To66:Form = 65To66:Fori1 = 65To66Fori2 = 65To66:Fori3 = 65To66:Fori4 = 65To66Fori5 = 65To66:Fori6 = 65To66:Forn = 32To126ActiveSheet.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)IfActiveSheet.ProtectContents =FalseThenMsgBox"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)ExitSubEndIfNext:Next:Next:Next:Next:NextNext:Next:Next:Next:Next:NextEndSub
- Press F5 or click the Run button on the toolbar and wait a couple of minutes. The macro will report a cracked password, which is not the original one (always some combination of A's and B's), but nevertheless it works.