Contraseña segura de hojas excel
Cordial Saludo
Muchachos sucede que quiero proteger una hoja de excel, sin embargo quiero que dicha hoja solo se desproteja usando dicha contraseña, tengo un código para desbloquear las hojas y siempre funciona, quisiera saber cual debo usar para que dicho código no funcione.
Anexo código.
Sub Descubrir_contraseña()
Dim a As Integer, b As Integer, C As Integer
Dim d As Integer, e As Integer, F As Integer
Dim a1 As Integer, a2 As Integer, a3 As Integer
Dim a4 As Integer, a5 As Integer, a6 As Integer
On Error Resume Next
For a = 65 To 66: For b = 65 To 66: For C = 65 To 66
For d = 65 To 66: For e = 65 To 66: For a1 = 65 To 66
For a2 = 65 To 66: For a3 = 65 To 66: For a4 = 65 To 66
For a5 = 65 To 66: For a6 = 65 To 66: For F = 32 To 126
contraseña = Chr(a) & Chr(b) & Chr(C) & Chr(d) & Chr(e) & Chr(a1) _
& Chr(a2) & Chr(a3) & Chr(a4) & Chr(a5) & Chr(a6) & Chr(F)
ActiveSheet.Unprotect contraseña
If ActiveSheet.ProtectContents = False Then
MsgBox "¡Enorabuena!" & vbCr & "La contraseña es:" & vbCr & contraseña
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub
Cordialmente
Leonardo Valencia