VBA code to print PDF file from Adobe Reader DC?

svendiamond

Well-known Member
Joined
Jun 13, 2014
Messages
1,504
Office Version
  1. 365
Platform
  1. Windows
I have been using this line of code to print a PDF file (from VBA in Excel) and it worked perfectly:

Code:
Shell "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe /p /h " & LocalFileName, vbHide

However, I just updated to the latest version of Adobe which is called Adobe Reader DC, and the code no longer works (no error, but it just doesn't print) even when I adjust for the new folder location. Does anyone happen to know if there is a new or different way to print a PDF file using VBA in Excel for Adobe Reader DC? I'm assuming it's the "/p /h" part that needs to change but I'm not sure.

Thank you in advance.
 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
the path seems to be here > C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader

so maybe

Shell "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe /p /h " & LocalFileName, vbHide
becomes
Shell "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe /p /h " & LocalFileName, vbHide
 
Upvote 0
the code no longer works (no error, but it just doesn't print) even when I adjust for the new folder location.


Yes, I tried that. And I have Googled this problem and searched through a lot of other forum posts, but couldn't find an answer. I was going to just try to do a better job of Googling but figured I'd ask here first in case anyone had a solution.
 
Upvote 0
the path seems to be here > C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader

so maybe

Shell "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe /p /h " & LocalFileName, vbHide
becomes
Shell "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe /p /h " & LocalFileName, vbHide

Fixed it!! Sorry about that, you were right. And I had that solution all along. The only trick was I had to disable protected view on Reader DC. Thanks!
 
Upvote 0

Forum statistics

Threads
1,216,128
Messages
6,129,030
Members
449,482
Latest member
al mugheen

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