View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Test if a file is password protected

i searched the newsgroup quickly & it seems you can't just determine
whether or not it has a password - you have to try to open it & let it
tell you, then deal with the "consequences". this thread might have
some help for you....


http://groups.google.com/group/micro...6d550f97240fb3


hth
susan

On Dec 27, 8:53*am, "Nigel" wrote:
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