Sub Mdp()
Workbooks.Open Filename:="C:\Transfert\MDP\Test.xls"
ActiveWorkbook.SetPasswordEncryptionOptions PasswordEncryptionProvider:= _
"Microsoft Strong Cryptographic Provider", PasswordEncryptionAlgorithm:="RC4", _
PasswordEncryptionKeyLength:=128, PasswordEncryptionFileProperties:=True
ActiveWorkbook.SaveAs Filename:="C:\Transfert\MDP\Test_Mdp.xls", FileFormat:= _
xlNormal, Password:="Azerty", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
End Sub