How to Print Existing PDF Pages Using Excel VBA
Question details
The user needs a method to print specific pages from an already existing PDF file using an Excel VBA macro.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Automating a document workflow where an existing PDF document must be sent to the printer directly from an Excel macro.
- Observed behavior
- Excel's native ExportAsFixedFormat method only creates new PDF files from Excel worksheets; it cannot read, open, or print an already existing PDF.
Ensure you have a default printer properly configured on your system and identify the installation path of your preferred PDF viewing application, as Excel requires external software to process and print PDF files.
Use VBA Shell Command with a PDF Application
The most reliable method is using VBA's Shell function to trigger the command-line printing interface of an installed PDF viewer.
Because Excel cannot natively print existing PDFs, you must call upon an external PDF program (such as Adobe Acrobat Reader or SumatraPDF) using command-line arguments. This method is fast and doesn't require complex API references.
Find the exact file path of your PDF reader's executable file (e.g., 'AcroRd32.exe' for Acrobat Reader) on your Windows system.
Open the VBA Editor (ALT + F11), create a new module, and use the Shell function. Construct a string that includes the PDF reader path, the print command parameter (often '/p' or '/t'), and the path to your existing PDF.
Run your VBA macro. The Shell command will open the PDF reader in the background, send the specified document to the default printer, and execute the print job.

Leverage OLE/COM Automation Interfaces
If you have a full version of Adobe Acrobat or another robust PDF library installed, you can use OLE/COM objects to gain granular control over the print job, including specifying page ranges.
Streamline Your PDF and Spreadsheet Workflows with WPS Office
Why rely on complex VBA workarounds and external applications to handle basic PDF tasks? WPS Office is a powerful, lightweight alternative to Microsoft Office that combines robust Spreadsheets, Documents, Presentations, and a full-featured PDF editor in one single workspace.
- 1. Download and Install: Visit the official WPS website to download the free installation package for your operating system.
- 2. Open Your Files: Launch WPS Office and open your spreadsheets and PDFs directly in the same application using its convenient tabbed interface.
- 3. Manage PDFs Natively: Use the integrated WPS PDF tools to view, edit, extract, or print specific pages of your PDF files without needing complex macros.

Frequently Asked Questions
Can Excel's ExportAsFixedFormat method print existing PDFs?
No, the ExportAsFixedFormat method is strictly designed to export or save the current Excel workbook or worksheet as a new PDF file. It cannot interact with or print PDF files that already exist on your system.
Do I need Adobe Acrobat installed to print PDFs via VBA?
You need some form of PDF reading application installed (like Adobe Acrobat, WPS PDF, or SumatraPDF) because Excel cannot process PDF files natively. The VBA Shell command relies on these external applications to execute the print job.
How do I silently print a PDF using Excel VBA without opening the viewer?
You can often achieve a 'silent' print by using specific command-line arguments in your VBA Shell command, such as the '/h' (hidden) parameter in Adobe Reader. However, the exact parameter depends on the specific PDF software you are using.
Can I specify a page range when printing a PDF using the VBA Shell command?
Most standard PDF viewers do not support specifying a page range via basic command-line arguments. To print specific pages, you usually need to use the application's OLE/COM API (such as Adobe Acrobat's AcroExch) or a specialized command-line utility.




