Checking to see if a workbook is password-protected
Posted by Jon Gossard on June 02, 2000 4:49 PM
First off, many thanks to Ivan for pointing me in the right direction regarding my last question! And thanks for letting me know about Chip Pearsons' excellent site! Anyway, here is my new problem:
I now have a VBScript program that, when given a folder, will update all .xls files in that folder, as well as all .xls files in every subfolder, with custom footer macro code. The problem is that when the program opens a password-protected file, it stops and waits for the password to be entered. Does anyone know how to check to see if an Excel file is password-protected *before* actually opening it??? That way, I could just log the "failed" update and move on to the next file. I'm aware of the HasPassword property but by the time I have access to that property it's too late!
Any ideas are *greatly* appreciated!