Hi,

My knowledge of VBA is patchy at best but i have found my around the below but experiencing issues!

I have a PO log spreadsheet that when opened on the click of a button will generate a new PO number. When I run the autosave it will save the file as a PDF into the exact designated location however, if the file name (PO Number) already exists it simply overwrites the file with the new version. Is there anyway i can ad a prompt "PO already in use" should the file already exist or continue should it not exist?? . i.e. I don't want to override at all!

Any help would be really appreciated.
Many thanks

Here's my current coding;

Sub Autosave()
Dim vDir

pdfname = ActiveSheet.Range("Q2")
vDir = "\\cdhnas\cdh\Reports\Internal PO Log\PO pdf's\"
fileSaveName = vDir & pdfname

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)"
End Sub