opening a pdf password protected document.

Rasberry

Board Regular
Joined
Aug 11, 2002
Messages
195
Office Version
  1. 365
This code opens my document and a popup box immediately shows up requesting the password. I know the password--so how do I autopopulate the pop-up box so the code can keep moving forward?

ActiveWorkbook.FollowHyperlink "I:\Securities\Cash Commitments & Projection\Downloads\PGPMessage07102023.pdf"
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Adobe Acrobat was the information that I was interested in, thank you very much. It may be that you have a specific version of it (paid?) That allows for enhanced functionality, but most people use the free basic version.

I don't think that the FollowHyperlink method by itself will get you to a solution, but I may be wrong. What I had hoped was that, once learning which software you were using, that we could try using the Shell method to execute the viewer with the pdf file, setting an option to open the file automatically with a password... But it turns out from my quick research that this is not possible with Adobe Acrobat, which is a bit frustrating.

I did a bit more digging and there is some free software called XPDFTools which includes a number of tools that are helpful when dealing with PDF files - like simple tools that extract text, or convert pages to images. It also include XPDFViewer, which performs the same PDF viewing function as Adobe Acrobat (but is a bit more basic). It allows for you to use the Shell method that I referenced above, but I don't know if this is a feasible option for you - it would require downloading the executable file, which is often prohibited on enterprise systems ...

I will give it some more thought, but maybe someone else will have a better solution? Here is a link to the viewer for your reference: xpdf(1)
 
Upvote 0
Thanks for you work on this! The solution which looks most probable, but I don't know how to code it is finding the popup box on my computer when it asks for the password and inserting the password. The code to find the child window looks really involved.
 
Upvote 0
Thanks for you work on this! The solution which looks most probable, but I don't know how to code it is finding the popup box on my computer when it asks for the password and inserting the password. The code to find the child window looks really involved.
That could be an option, yes, but more involved. Do you have a screen capture of the viewer/popup box?
 
Upvote 0
That could be an option, yes, but more involved. Do you have a screen capture of the viewer/popup box?
Yes, here it is:
Pdf pop-up box.PNG
 
Upvote 0

Forum statistics

Threads
1,215,510
Messages
6,125,228
Members
449,216
Latest member
biglake87

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