I have created a macro to export the sheet template to PDF:
ActiveWorkbook.Sheets(\"Sheet2\").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ActiveWorkbook.
Your actual code works for me. However try this (TRIED AND TESTED)
Sub Sample()
ActiveWorkbook.Sheets("Sheet2").Activate
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=ActiveWorkbook.Path & "\Survey Report.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Note:
Sheet2
has something in it to print else a blank sheet will give you the error.ActiveWorkbook
to ThisWorkbook
and try again...