Sub PDfExist()
MyPath = ActiveWorkbook.Path & "\Morning Reports\"
fn = "Morning Report" & "_" & Format(Now(), "mm.dd.yy") & ".PDF"
fname = MyPath & fn
FileInQuestion = Dir(fname)
If FileInQuestion <> "" Then
If InputBox("File exists, overwrite (y/n) ? ") <> "y" Then
fn = "Morning Report" & "_" & Format(Now(), "mm.dd.yy hh.mm") & ".PDF"
fname = MyPath & fn
End If
End If
Sheets("Morning Report").Range("A1:k46").ExportAsFixedFormat Type:=xlTypePDF, Filename:=fname, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Bookmarks