I am using a macro (excel 2007 sp2) to export an excel document of a purchase order to a PDF and saving it to a specific location on the server with the name of the file coming from a cell range to name the file as the purchase order number. The problem is that if the PDF already exists of the same name, I am not getting the prompt to replace the existing file and it is just overwriting the file. Here is the code of my macro:
Sub Macro1()
Application.DisplayAlerts = True
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, OpenAfterPublish:=True, Filename:= _
"S:\Office Documents\Purchase Orders\" & ActiveSheet.Range("F5").Value
Quality = _
xlQualityStandard
IncludeDocProperties = True
IgnorePrintAreas = False
End Sub
I would greatly appreciate any help I can get so I can release this document for use in our office. I just really want to make sure that no files are that easily overwritten.
Bookmarks