Sub Mail()
Dim destinataires$, sujet$, fichierjoint$, chemin$, nom$, derl&, i&
With Feuil1
derl = .Cells(Rows.Count, "B").End(xlUp).Row
nom = .Range("n2").Value & ".xls" ' À adapter
For i = 2 To derl
destinataires = destinataires & .Cells(i, "B")
Next i
End With
sujet = " fichiers"
body = "Veuillez trouver ci-joint fichier des données ; Cordialement"
chemin = "Q:\CDG_DIR_OP\"
fichierjoint = chemin & nom
'Ici peut-être faut rajouter .exe
strcommand = "C:\Program Files\Mozilla Thunderbird\thunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataires & "'"
strcommand = strcommand & "," & "subject=" & sujet & ","
strcommand = strcommand & "body=" & body
strcommand = strcommand & "," & "attachment=file:///" & fichierjoint
Call Shell(strcommand, vbNormalFocus)
End Sub