Print PDF Pages in a Custom Order with Adobe Acrobat VBA
Question details
The user needs to print selected pages from a PDF in a nonsequential order through an Excel VBA macro.

- 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.
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.
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.
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".
Set pdfPrintPages to the pages in the required output order, for example: pdfPrintPages = "2,1,10,4".
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.
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.
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.

Correct the Acrobat automation target before printing
Use this method if an existing VBA routine is intended to automate Acrobat but is sending the active Excel workbook to the printer.
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. Download WPS Office: Select Download WPS Office Free and install WPS Office on your computer.
- 2. Open the workbook: In WPS Spreadsheets, select Menu > Open and choose the existing XLS or XLSX workbook.
- 3. Review workbook content: Check formulas, layouts, and any required macro-related workflow before using the workbook in production.

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.




