Creating Individual PDFs of Multiple Files with Bookmarks

AliMass

New Member
Joined
Jun 4, 2015
Messages
14
Hello,

I'm using Excel 2010 and have Acrobat XI Standard.

I have about 50 Excel files that I want to turn into 50 individual PDF files. Each Excel file has many sheets, and I want each PDF file to contain all the sheets and have a bookmark for each sheet. The bookmark should be the same as the sheet name.

In summary, I wrote a macro that will save each file as a PDF with all the sheets, but it will not include bookmarks. Here is my process:

From Excel, I can open a file and click File > Save as Adobe PDF. This will save as PDF with bookmarks, so the process is good, and I need to adapt this to run for all files.

I recorded the Macro and got the command ExportAsFixedFormat. Here is the line of code I used:

Code:
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF,
Filename:=strNewFileName, Quality:=xlQualityStandard,
IncludeDocProperties:=False, IgnorePrintAreas:=False,
OpenAfterPublish:=False

While the code runs fine and creats PDFs, it will not save bookmarks. A possible issue is when I manually use File > Save as PDF, I noticed the option to use bookmarks is not on the initial dialog; instead, later when choosing the filename, there is an Options button with a checkbox to create bookmarks. I cannot find a way to use the code and also to create bookmarks.

I searched online, and the Word version of ExportAsFixedFormat has an option for bookmarks, but I cannot find an equivalent parameter for Excel.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,223,478
Messages
6,172,493
Members
452,463
Latest member
Debz

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