Excel Remove Sheet Protection

sheet_protection2

Yesterday a User did ask for help, because of a Excelfile with a Sheetprotection. The user forget the password and without the valid password it was not possible to edit the excel sheet.

A quick research in with google showed me that the excel sheet password protection is very weak and can be easily removed.

Hit ALT + F11 to open the VB Editor. Select the Excelsheet in put in the following code:

Sub SchutzEntfernen()
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 n = 65 To 66
For o = 65 To 66: For p = 65 To 66
For q = 65 To 66: For r = 65 To 66
For s = 65 To 66: For t = 32 To 126
ActiveSheet.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 „Blattschutz abgeschaltet“
End Sub

Close the VB editor and hit ALT + F8 to start the VB script. Wait until you see the message box that the sheetprotection is removed.

sheet_protection3 sheet_protection4

sheet_protection5

Another way that I did not test, but has the same effect is to open the Excelfile with 7-zip

sheet_protection6

Navigate to xl\worksheets Edit the sheet xml file with notepad or another text editor.

sheet_protection7

Search for password. Remove everything that the value after password =“ “ is emty.

sheet_protection8

Save the xml file back and open the excel sheet again. The sheet protection should be removed now.

 

sheet_protection9

The same works also with a Office 2013 excel file. Inside the xml file search for and remove the whole bracket.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.