Try the code this way
Sub Autosave()
Dim vDir
Dim strFileExists, pdfname, fileSaveName As String
pdfname = ActiveSheet.Range("Q2")
vDir = "\\cdhnas\cdh\Reports\Internal PO Log\PO pdf's\"
fileSaveName = vDir & pdfname
strFileExists = Dir(fileSaveName, vbDirectory)
If strFileExists = "" Then
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fileSaveName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
MsgBox "PDF File Saved (Reports\Internal PO Log\PO pdf's)"
Else
MsgBox "The file exists"
End If
End Sub
Bookmarks