Private Sub CommandButton1_Click()
Dim Ma_Cell As Range
Dim Ctrl As OLEObject
Dim Mon_Pass As String
Dim N_Cls As Workbook
Dim Chemin As String
Chemin = ThisWorkbook.Path
Mon_Pass = InputBox("Mot de passe SVP ?", "Crypter...")
If Mon_Pass = "" Then
MsgBox "Impossible de crypter sans mot de passe !"
Exit Sub
End If
Application.ScreenUpdating = False
'modif ---//
Sheets("AAA").Copy
Set N_Cls = ActiveWorkbook
With N_Cls.ActiveSheet
For Each Ma_Cell In .UsedRange
If Not IsEmpty(Ma_Cell) Then Ma_Cell.Value = _
QuickEncrypt(Ma_Cell.Value, Mon_Pass)
Next Ma_Cell
End With
MsgBox "Texte crypté !"
'modif ---//
With N_Cls
For Each Ctrl In .Sheets(1).OLEObjects
If Ctrl.ProgId = "Forms.CommandButton.1" Then Ctrl.Delete
Next Ctrl
.SaveAs Chemin & "\" & "toto" & Format(Time, "hhmmss") & ".xls"
.Close
End With
'--------------//
Application.ScreenUpdating = True
End Sub