Voici le code :
Sub envoi_pdf_mail()
Dim ret As Integer
ret = MsgBox("Envoi du formulaire par mail." & Chr(10) & Chr(10) & "Voulez-vous continuer ?", vbYesNo + vbQuestion, "Envoyer par mail")
If ret = vbNo Then
Exit Sub
Else
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurFile As String
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
CurFile = ThisWorkbook.Path & "\" & "fichier - " & Sheets("fichier").Range("A10").Value
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=CurFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
With olMail
.Display '.Send
.To = "mail@mail.fr"
.CC = ""
.Subject = "Envoi du fichier"
.HTMLBody = "<html><body>Bonjour," & "<br><br>" & "Veuillez trouver en pièce jointe le fichier." & "<br><br>" & "Vous souhaitant bonne réception." & "<br><br>" & "Cordialement," & "</html></body>" & .HTMLBody
.Attachments.Add ThisWorkbook.Path & "\" & "fichier - " & Sheets("fichier").Range("A10").Value & ".pdf"
End With
Set olMail = Nothing
Set olApp = Nothing
Kill ThisWorkbook.Path & "\" & "fichier - " & Sheets("fichier").Range("A10").Value & ".pdf"
End If
End Sub
Pour rappel ce code fonctionne parfaitement bien sur mon PC (Excel 2016)
La référence Outlook library est bien présente