Sub exportaspdf()
Dim desktoploc As String
Dim filename As String
Dim mypath As String
desktoploc = CreateObject("WScript.Shell").SpecialFolders("Desktop")
filename = ThisWorkbook.Name
mypath = desktoploc & "" & filename
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:=mypath, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub