Hello, i have a print to pdf macro. The macro works fine, but when i want to save a pdf the save as dialog does not prompt me to overwrite or not. Example; When i choose the same folder and same name of document, excel does not ask if i want to overwrite the old pdf with the new.
What do to?
Sub Make_PDF()
On Error GoTo Errorhandler
filesavename = Application.GetSaveAsFilename(InitialFileName:="Offert", filefilter:="PDF files (*.pdf), *.pdf")
If filesavename = False Then Exit Sub
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=filesavename _
, Quality:=xlQualityMedium, IncludeDocProperties:=False, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
Exit Sub
Errorhandler:
MsgBox "Exit all other open pdf documents", vbOKOnly, "An error occured"
End Sub
Bookmarks