Odheslování listu nebo celého sešitu




1. V Excelu si otevřete onen uzamčený dokument
2. Stiskněte Alt+F11, otevře se vám IDE pro Visual Basic
3. Ve stromečku vlevo nahoře dvoklikněte na ThisWorkbook
4. Do nově otevřeného okna vložte následující kód


'*****************************************

' modUnlockRoutines
' ' Module provides Excel workbook and sheet unlock routines. The algorithm
' relies on a backdoor password that can be 1 to 9 characters long where each
' character is either an "A" or "B" except the last which can be any character
' from ASCII code 32 to 255.
' ' Implemented as a regular module for use with any Excel VBA project.
' ' © 2007 Kevin M. Jones


Option Explicit

Private Sub DisplayStatus( _ ByVal PasswordsTried As Long _ )

' Display the status in the Excel status bar.
' Syntax
' DisplayStatus(PasswordsTried)
' PasswordsTried - The number of passwords tried thus far.

Static LastStatus As String
End Sub


Private Function TrySheetPasswordSize( _ ByVal Size As Long, _ ByRef PasswordsTried As Long, _ ByRef Password As String, _ Optional ByVal Base As String _ ) As Boolean

' Try unlocking the sheet with all passwords of the specified size.
' TrySheetPasswordSize(Size, PasswordsTried, Password, [Base])
' Size - The size of the password to try.
' PasswordsTried - The cummulative number of passwords tried thus far.
' Password - The current password.
' Base - The base password from the calling routine.

Dim Index As Long

On Error Resume Next
On Error GoTo 0
DisplayStatus PasswordsTried
End Function


Private Function TryWorkbookPasswordSize( _ ByVal Size As Long, _ ByRef PasswordsTried As Long, _ ByRef Password As String, _ Optional ByVal Base As String _ ) As Boolean

' Try unlocking the workbook with all passwords of the specified size.
' TryWorkbookPasswordSize(Size, PasswordsTried, Password, [Base])
' Size - The size of the password to try.
' PasswordsTried - The cummulative number of passwords tried thus far.
' Password - The current password.
' Base - The base password from the calling routine.

Dim Index As Long
On Error Resume Next
If IsMissing(Base) Then Base = vbNullString