PDF Printing Issues

Print PDF Pages in a Custom Order with Adobe Acrobat VBA

John WilsonJohn Wilson Nov 12, 2026 869 views

Question details

The user needs to print selected pages from a PDF in a nonsequential order through an Excel VBA macro.

Print PDF Pages in a Custom Order with Adobe Acrobat VBA
Product
Adobe Reader or Adobe Acrobat with Microsoft Excel VBA
Device & OS
not provided
Scenario
A VBA procedure must send a PDF file to a specified printer and request pages in an order such as 2, 1, 10, and 4.
Observed behavior
Incorrect Adobe Acrobat automation can cause the macro to print the Excel workbook instead of the intended PDF file.
Before you start

Confirm that Adobe Reader or Acrobat is installed and identify the full path to its executable file. Also verify the exact printer name shown in Windows printer settings before adding it to the VBA command.

Solution 1Recommended

Run Adobe Reader or Acrobat from VBA with the PDF path and page order

Use this approach when Acrobat automation prints the workbook or does not reliably target the PDF document.

Instead of automating an Acrobat object from VBA, build a command-line call that explicitly identifies the Reader or Acrobat executable, the PDF file, the printer, and the requested page sequence. Update the paths and printer name to match your computer.

1
Set the PDF file path

In the VBA editor, open the module containing your macro and set pdfFilePath to the full PDF location, for example: pdfFilePath = "C:\Path\document.pdf".

2
Specify the custom page sequence

Set pdfPrintPages to the pages in the required output order, for example: pdfPrintPages = "2,1,10,4".

3
Build the Adobe print command

Create the command with the Adobe executable, PDF path, and printer name: printCommand = "AcroRd32.exe /N /T """ & pdfFilePath & """ ""Microsoft Print to PDF"" /p " & pdfPrintPages. Replace AcroRd32.exe with the full executable path if it is not available through the system PATH.

4
Run the command from the macro

Use Shell printCommand, vbHide to launch the Adobe print command. Replace "Microsoft Print to PDF" with the exact name of the printer you want to use.

5
Test the requested order

Run the macro with a short PDF and confirm that the printer receives pages 2, 1, 10, and 4 in that sequence before using the command for a longer document.

Run Adobe Reader or Acrobat from VBA with the PDF path and page order
Command support can vary: Adobe Reader and Acrobat command-line behavior can differ by version and installation. If the command is not found, use the full path to AcroRd32.exe or Acrobat.exe and confirm the printer name exactly matches Windows.
Free Microsoft Office alternative

Use WPS Office for Lightweight Excel VBA Workbook Workflows

If your Excel VBA workflow is affected by Microsoft Office or Acrobat integration issues, WPS Office provides a free, lightweight office alternative with a familiar interface and straightforward migration for compatible spreadsheet files. You can continue working with common workbook formats while using a separate PDF printing workflow where needed.

  1. 1. Download WPS Office: Select Download WPS Office Free and install WPS Office on your computer.
  2. 2. Open the workbook: In WPS Spreadsheets, select Menu > Open and choose the existing XLS or XLSX workbook.
  3. 3. Review workbook content: Check formulas, layouts, and any required macro-related workflow before using the workbook in production.
Opens and edits common Microsoft Excel workbook formats, including XLS and XLSX.Provides a familiar spreadsheet interface for users moving from Microsoft Office.Offers a lightweight, free office suite for everyday workbook tasks.Supports PDF viewing and printing workflows alongside office documents.
microsoft office alternative - wps office

Frequently Asked Questions

Can VBA print PDF pages in an order that is different from the document order?

Yes. Set a comma-separated page sequence, such as "2,1,10,4", in the command string and pass it with the PDF path and target printer.

Why does my VBA macro print the Excel workbook instead of the PDF?

The code may be calling an Excel PrintOut method, or Acrobat automation may not be correctly opening and targeting the PDF. Remove workbook print calls and explicitly pass the PDF path to Adobe Reader or Acrobat.

Where do I find the printer name for the VBA command?

Open Windows Settings > Bluetooth & devices > Printers & scanners, select the printer, and use its displayed name exactly as it appears in the VBA command.

What should I do if VBA cannot find AcroRd32.exe?

Replace AcroRd32.exe in the command with the full installation path to Adobe Reader or Acrobat, then run the macro again.

Can I use Microsoft Print to PDF with this command?

Yes, you can use "Microsoft Print to PDF" as the printer name. Depending on the Windows configuration, it may prompt you to choose the output PDF file location.