Hello, looking for some help on exporting a sheet to a PDF. Using Excel for MAC 2016. this is driving me crazy. Everywhere i search the same syntax is used, yet not for me.
the macro runs, initially i get a "Save" box telling me it is preparing
then a print error box,
once i hit OK I get
Run-time error '1004':
Method 'ExportAsFixedFormat' of object '_Worksheet' failed
Sub PDF()
Dim wksheet As Worksheet
Dim filename As String
Set wksheet = ThisWorkbook.Sheets("Calculator")
filename = ActiveWorkbook.Path & "temppdf.pdf"
With wksheet
.PageSetup.PrintArea = Range("A1", "N46").Address
End With
wksheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
filename:=filename, _
quality:=xlQualityStandard, _
includedocproperties:=True
End Sub
Bookmarks