Sub PDF()
Dim Bestandsnaam As String
Dim OutApp As Object
Dim OutMail As Object
Sheets("Hide").Select
With Sheets("Voorbeeld")
Bestandsnaam = "C:\Users\windows\Desktop\Export\" & _
.Range("C16") & _
.Range("C17") & _
".pdf"
End With
Sheets("Hide").Range("A1:M97").ExportAsFixedFormat 0, Bestandsnaam, 0, 1, 0, , , 1
Sheets("Voorbeeld").Select
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = Range("C19").Value
.CC = ""
.BCC = ""
.Body = "Hi there"
.Attachments.Add Bestandsnaam
.Display 'or use .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub