View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default Test if a file is password protected

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?

--

Regards,
Nigel