adesso è
Data Rivoluzionaria
rimozione password
Visual Basic MS Office Excel macro fogli elettronici
esempio
aprire VBA con alt-F11 inserire nuovo modulo incollare la istruzione seguene: ----------------------- Option Explicit Dim arr As Variant Dim arr2(30) As Long Sub IniziaArr2() Dim i As Integer arr = Array(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 _ , 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, _ 524288, 1048576, 2097152, 4194304, 8388608, 16777216, _ 33554432, 67108864, 134217728, 268435456, 536870912, _ 1073741824) 'valori da 2^0 a 2^30 For i = 0 To 30 arr2(i) = arr(i) Next i End Sub Function decbin(dec As Long) As String Dim i As Integer, a As Integer, bin As String bin = "0" 'nel caso dec sia = 0 For i = 30 To 0 Step -1 If dec And arr2(i) Then bin = "" For a = i To 0 Step -1 Select Case dec And arr2(a) Case 0 bin = bin & "0" Case Else bin = bin & "1" End Select Next a Exit For End If Next i decbin = bin End Function Sub psw2() Dim i As Long Dim start As Single Dim bin As String Call IniziaArr2 start = Timer On Error Resume Next i = 0 Do i = i + 1 bin = decbin(i) ActiveSheet.Unprotect Password:=bin Loop While ActiveSheet.ProtectContents = True MsgBox "La password è stata rimossa con " & _ bin & " che è il binario di " & i & _ Chr(10) & "il programma ha impiegato " & _ Timer - start & " secondi" Debug.Print bin & " " & i End Sub ---------------------- chiudere VBA eseguire macro psw2

Please publish modules in offcanvas position.