Print and Name a File as a PDF from Excel

Darth_Alicious

New Member
Joined
Apr 24, 2017
Messages
4
Hello all,

I am attempting to create an Excel VBA Macro for my job to:

1. Fill a fillable PDF from an Excel Table
2. Save a copy as "filename.pdf" (The filename in question comes from a specific cell in the excel table).
3. Print that copy to PDF in a different folder using Adobe PDF (to render it non-fillable) as "filename_copy.pdf"
4. Loop the process.

I have everything down except for the "print to pdf" part. The fillable PDF fills and saves just fine. I have the following line in my program:

Code:
objAcroAVDoc.PrintPages 1, 2, 2, True, True

This works to print the created PDF, but it asks me to name the file every time. My question is: Is it possible to automatically print to PDF from Excel and have the doc named "filename_copy.pdf", either from the existing PDF being printed, or from the same cell in Excel as the first PDF gets its name?

To clarify, I am NOT printing a paper copy, I am using Adobe PDF as a printer to create a second PDF that loses the fillable fields.

Thank you!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,214,865
Messages
6,121,988
Members
449,060
Latest member
mtsheetz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top