Test if a file is password protected

N

Nigel

I have a process that sequentially opens and processes all xls files in a
chosen folder. This works OK, however if I come across a file with a
password open protection, I wish to detect it, then pass over these files.

I am using the following to open each file

Set wB = Workbooks.Open(myFile)

If the file has an open password I get the standard dialog to enter a
password.

How can I avoid this by detecting a the file is password protected?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top