• Passwords

    Author
    Topic
    #353347

    I have been working in a spreadsheet that contains confidential information. I password protected so the user would need to enter a password to open the file. I have forgotten the password. Is there away around this problem?

    Thanks

    Viewing 6 reply threads
    Author
    Replies
    • #516560

      Deborah,

      Microsoft never claimed that the password protection of their spreadsheets was bulletproof (if this is the correct word in English for this). You can write your own code to unprotect your spreadsheet (that doesn’t mean that you’ll obtain the password, but the problem is solved anyhow). I add some code that I wrote to experiment with unprotecting the active spreadsheet. The code is limited in the sense that it has to be adapted if the password has more than 5 characters. What the code does is actually very simple: it tries all kind of combinations, trying to unprotect the sheet.

      Sub Cracker()
      Dim h As Integer
      Dim i As Integer
      Dim j As Integer
      Dim k As Integer
      Dim l As Integer
      Dim pwd As String
      Dim tijd, delay
      tijd = Time
      Application.StatusBar = Format$(Time – tijd, “hh:mm:ss”)
      ‘1 kar
      For l = 32 To 255
      pwd = Chr$(l)
      On Error Resume Next
      ActiveSheet.Unprotect (pwd)
      If Err = 0 Then
      MsgBox “Spreadsheet unprotected”
      On Error GoTo 0
      Exit Sub
      Else
      On Error GoTo 0
      End If
      Next l
      Application.StatusBar = Format$(Time – tijd, “hh:mm:ss”)
      ‘2 kar
      For k = 2 To 1 Step -1
      Application.StatusBar = Format$(Time – tijd, “hh:mm:ss”)
      For l = 32 To 96
      pwd = Chr$(k) & Chr$(l)
      On Error Resume Next
      ActiveSheet.Unprotect (pwd)
      If Err = 0 Then
      MsgBox “Spreadsheet unprotected”
      On Error GoTo 0
      Exit Sub
      Else
      On Error GoTo 0
      End If
      Next l
      Next k
      ‘3 kar
      For j = 2 To 1 Step -1
      For k = 2 To 1 Step -1
      Application.StatusBar = Format$(Time – tijd, “hh:mm:ss”)
      For l = 32 To 96
      pwd = Chr$(j) & Chr$(k) & Chr$(l)
      On Error Resume Next
      ActiveSheet.Unprotect (pwd)
      If Err = 0 Then
      MsgBox “Spreadsheet unprotected”
      On Error GoTo 0
      Exit Sub
      Else
      On Error GoTo 0
      End If
      Next l
      Next k
      Next j
      ‘4 kar
      For i = 2 To 1 Step -1
      For j = 2 To 1 Step -1
      For k = 2 To 1 Step -1
      Application.StatusBar = Format$(Time – tijd, “hh:mm:ss”)
      For l = 32 To 96
      pwd = Chr$(i) & Chr$(j) & Chr$(k) & Chr$(l)
      On Error Resume Next
      ActiveSheet.Unprotect (pwd)
      If Err = 0 Then
      MsgBox “Spreadsheet unprotected”
      On Error GoTo 0
      Exit Sub
      Else
      On Error GoTo 0
      End If
      Next l
      Next k
      Next j
      Next i
      ‘5 kar
      For h = 2 To 1 Step -1
      For i = 2 To 1 Step -1
      For j = 2 To 1 Step -1
      For k = 2 To 1 Step -1
      Application.StatusBar = Format$(Time – tijd, “hh:mm:ss”)
      For l = 32 To 96
      pwd = Chr$(h) & Chr$(i) & Chr$(j) & Chr$(k) & Chr$(l)
      On Error Resume Next
      ActiveSheet.Unprotect (pwd)
      If Err = 0 Then
      MsgBox “Spreadsheet unprotected”
      On Error GoTo 0
      Exit Sub
      Else
      On Error GoTo 0
      End If
      Next l
      Next k
      Next j
      Next i
      Next h
      Application.StatusBar = “”
      End Sub

      • #516564

        Thanks for the information. I am anxious to try it out, however, where do I put the code? Do I create a blank spreadsheet and type in the code in a VBA module? Sorry for being so slow…..

        I appreciate your help!

        • #516607

          Password crackers are available (for money) at

          http://www.LostPassword.com [/url]

          From an advert in Woody’s Office Watch

        • #516666

          Deborah,

          I see that you’ve got some interesting suggestions from other people. You can indeed find all kind of cracker software for Excel spreadsheets and add-ins on the web. The code that I gave to you can simply be pasted into a module and then from the Excel >> Tools >> Macro menu be run. There is not danger of anything. If it takes too long just interrupt it by using ctrl break. The only thing the code does is making a password, try to unprotect the sheet with that password, if not successful, a new password is tried out etc., until the spreadsheet is unprotected.

          • #516667

            and make the protected worksheet active before you run the macro (it actually applies on the active worksheet)

    • #524397

      There is a difference between worksheet/workbook protection and “open the file” passwording. Protection is basically to eanble you to stop yourself or users from doing things you don’t want to, either accidentally or on purpose, whereas “open” passwording a workbook either prevents access or stops you saving over the active copy. Because protection can utilise passwords, the two can become confused.

      I have some home-grown code that is similar to Hans’ but goes for the “Open” password as opposed to the protection password but it is very slow so I won’t post it. However, he does build his password string differently to mine and that may speed things up. If you’re prepared to spend money then the link above – or any mentioned at j-walk should get you on your way.

      Brooke

    • #524429

      Steven,

      As Brooke said, my code works only for open workbooks with protected worksheets. You need to buy a password cracker if you want to recover your workbook. Some of these crackers have trial versions which allow you to find the first three characters of your password. Maybe this is sufficient for you to remember the whole password. Have a look at the websites mentioned in this thread.

      • #524445

        I went back and had a proper look at your code.

        How did you discover that? and while I’m asking questions, why “2 to 1 step -1” instead of “1 to 2”?

        Brooke

        • #524497

          It’s quite a while ago that I wrote this code. Excel has a strange way to deal with passwords. Actually, your spreadsheet password is not unique. There are many other passwords (with the same length, that’s important) that will unprotect your spreadsheet. My code does not discover your password, but will unprotect the sheet. The ‘other’ passwords may also contain control characters. I discovered via trial-and-error that the execution time could be shortened by restricting to the combinations that are actually in the code. I can’t remember why I used “2 to 1”, maybe it’ll work with “1 to 2”. Just try it out, byt protecting a sheet with a small e.g. 4-letter password, run the code and see if it is possible to unprotect the sheet.

    • #524502

      For a free add-in that can find lost passwords for excel (but not vba modules) try this site from Erlandsen Data Consulting.
      http://www.erlandsendata.no/english/downloads/tools.htm

      Tony

    • #524520

      Azri,

      Any chance you could open this workbook?

      Go ahead……

      Brooke

    • #524526

      And while we’re on the subject, the maximum allowable length of a workbook open password is 15 – I believe. Does anyone know the maximum length of a worksheet protection password?

      Brooke

    • #524530

      so what program is that?

      Brooke

    Viewing 6 reply threads
    Reply To: Passwords

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: