I am using this command in Excel VBA to print an existing PDF file as PDF
This works great, however I would like to be able to overwrite the existing file. It obviously gives me an error message, that the file is being used, therefore I cannot overwrite it.
Is there a way to do this?
If not, is there a way to set a different predefined file name for the printed file? E.g. the file that needs to be printed is Range("A8") & "invoice.pdf" and the printed PDF would suggest Range("A8") & "invoice_printed.pdf"
Any help is appreciated!
VBA Code:
Shell """" & "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" _
& """/p /h """ & ActiveWorkbook.Path & "\" & Range("A8") & "invoice.pdf" & """"
This works great, however I would like to be able to overwrite the existing file. It obviously gives me an error message, that the file is being used, therefore I cannot overwrite it.
Is there a way to do this?
If not, is there a way to set a different predefined file name for the printed file? E.g. the file that needs to be printed is Range("A8") & "invoice.pdf" and the printed PDF would suggest Range("A8") & "invoice_printed.pdf"
Any help is appreciated!