Jump to content
News Ticker
  • Welcome to the Community
  • Use the forum to troubleshoot your Excel & VBA Problems
  • We will be launching a new website soon! www.ExcelWTF.com/Learn ! Join us to learn VBA from the ground up!
  • 0
Sign in to follow this  
crazyclix

Using excel to open external application and executing a task

Question

Hi Folks,

 

So, I've got to do this repetitive task at work that involves inputting certain text (eg: ABCDE) in an excel cell and using that data to open an external file (.PDF) and protecting that with the cell's data (ABCDE) as the document open password.

 

Since, it is a work PC, I cannot install a macro recorder or any external application. Can this be done using excel or any other native application in Windows 7?

 

Additional Info:

1. What is the cell reference for where you input the data (ABCDE) eg. Sheet 1 Cell A5

A. 1. Sheet 1 cell d5

 

2. How does the entered text relate to the PDF?

The entered text should be used to password protect the document. Document open password and not permissions password.

 

3. What is the file location for the PDF? (Filepath)

 

C:/folder/ (macro should be able to password protect all files in this folder with cell d5's content as the document open password)

 

4. What is being password protected? The PDF or the original Spreadsheet?

The pdf file located in the path mentioned above.

 

Thanks a ton for your help.. icon_smile.gif

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi CrazyClix, 

 

Welcome to the board. So can I confim this is what needs doing.

 

  1. You input a String Text in Sheet 1, Cell D5. 
  2. The macro launches and opens the location C:/folder/
  3. The macro puts a file open password on all files in the above filepath

 

Is this correct?

 

Follow up queries:

  1. What type of files do you have in the file path. Only PDFs? Or are there others like .xlsx, .docx etc
  2. Do you have Adober Reader? or Adobe DC/Pro?

 

Let me know 

Many Thanks

Caleeco

Share this post


Link to post
Share on other sites
  • 0

Hi, thank you :)

 

Your understanding is perfectly right. Yes, they're all gonna be pdf documents and I use Adobe standard X

 

Good luck with the forum... the design is pretty neat.

Regards,

Crazyclix

Share this post


Link to post
Share on other sites
  • 0

Hi Crazy! Sorry for the delay! 

I've been meaning to get round to this request. I only have Adobe Reader on my machine, so I cannot do any password protection using VBA. Hence why I havent worked on this (as I can't do any testing). I may be able to get a full license for Adobe from work. Hopefully I'll hear back from IT in the next day or two!

 

Apologies for the wait

Caleeco

Share this post


Link to post
Share on other sites
  • 0
Hi Crazy! Sorry for the delay! 

I've been meaning to get round to this request. I only have Adobe Reader on my machine, so I cannot do any password protection using VBA. Hence why I havent worked on this (as I can't do any testing). I may be able to get a full license for Adobe from work. Hopefully I'll hear back from IT in the next day or two!

 

Apologies for the wait

Caleeco

Not a problem at all, Caleeco :)

I'll be waiting

Share this post


Link to post
Share on other sites
  • 0

Hi Crazyclix, 

 

I have got hold of Adobe Acrobat XI, and started doing some research on how to control PDF Security settings. It would seem that with Adobe, Security settings of existing PDFs cannot be manipulated by VBA. See references below:

https://forums.adobe.com/thread/1886984

https://forums.adobe.com/thread/1980464

https://forums.adobe.com/thread/854922

https://answers.acrobatusers.com/Is-it- ... 37328.aspx

 

It would seem that PDFs use JavaScript that can't be directly manipulted by VBA, but need C/C++ to do-so instead. However, From my search the guy who posted in this thread (Solomraj) last month suggests he know how to do it with VBA. Might be worth dropping him an email!

http://www.mrexcel.com/forum/excel-ques ... -file.html

 

Sorry I can't be of more help, this is beyond my capability it would seem!

Regards

Caleeco

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×