I have the following line of code which is supposed to take an excel spreadsheet, and save it as a PDF file.
It was working correctly and saving the PDF files in the same directory that the file was opened in, but suddenly it does not seem to be saving the PDF files in the right place.
Sometimes it saves it and sometimes it does not. Is there a way I can update my code to include a specific location or the location that the file was opened in?
Sheets("Mortgage Charts").Activate
Range("L2").Select
With Sheets("Mortgage Charts")
.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="Mortgage Scorecard " & Format(.Range("L2"), "mm-dd-yyyy"), _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End With