Jump to content

Recommended Posts

Posted

Hi there, I have an old XLS spreadsheet, the workbook itself is not protected, you can open it up and view the data, but the individual sheets are protected. That means I cant view the formulas. I have stumbled across various software that claims to remove excel passwords but they old seam to apply to protected workbooks NOT sheets.

Does anyone know of a way to remove this protection without knowing the password?

 

JK

Posted (edited)

I use this code that i found years ago, helps alot with all those students that instantly forget thier paaswords :)

 

Add it to vba in the workbook and run (at your own risk obviously =p )

Sub PassCrack() 'Breaks worksheet password protection.
   
   Dim i, j, k, l, m, n, i1, i2, i3, i4, i5, 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 "Your sheet is now unprotected, please " & _
       "remember to reprotect with a more MEMORABLE " & _
       "password", vbOKOnly, "Password removed"
       Exit Sub
   End If
   
   Next: Next: Next: Next: Next: Next: Next: Next: Next: Next: Next: Next
End Sub


 

 

Jon

Edited by amvc
instructions added
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...