VBA Export to PDF with Adobe Acrobat API

tjdickinson

Board Regular
Joined
Jun 26, 2021
Messages
61
Office Version
  1. 365
Platform
  1. Windows
I am running a macro that executes numerous operations on a file, and I want it to automatically save and export to PDF at the end. It must use the Acrobat add-in, not Excel's built-in PDF conversion, because each sheet needs to be bookmarked in the output (and that's not possible with the built-in engine).

I'm still quite green when it comes to VBA, and even more ignorant when it comes to Adobe API. So I need help.

Here are the parameters I need:
  • Create PDF: entire workbook, actual size << these are the options in the 'Create PDF' window of the Acrobat add-on. Each file I have has a different number of pages.
  • Conversion settings: Standard(1) << custom settings which includes adding bookmarks for each worksheet
  • Location: parent directory (up one directory from the location of the Excel file)
  • File name:
    • The Excel file name will look something like this: 21-22 January v6.R3.1234 ... _Leerkrachten
    • After the 1234, there may be additional text which should be removed from the PDF file name
    • The suffix _Leerkrachten should be replaced with _LK
      Two other possible suffixes: _Leerlingen >> _LL // _pauze >> _TZ
  • Do not view file on export
Thank you in advance for any help you can give!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,224,930
Messages
6,181,826
Members
453,067
Latest member
mdiz777

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