Hi,
I have following code for saving it in PDF format at specific location. Thanks to James006 for the excellent help.
Now I want it to be attached to an email ( using form button) . How do I go about doing this?
I have following code for saving it in PDF format at specific location. Thanks to James006 for the excellent help.
Now I want it to be attached to an email ( using form button) . How do I go about doing this?
Code:
Sub exportaspdf() Dim desktoploc As String
Dim filename As String
Dim mypath As String
desktoploc = CreateObject("WScript.Shell").SpecialFolders("Desktop")
filename = ThisWorkbook.Name
mypath = "C:\2013" & "\" & filename
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:=mypath, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub