Excel bypassing Word password

R

Ray C

I have an Excel workbook that loops through a bunch of Word documents in a
folder and processes each Word document. The problem is that some Word
documents ask for a password when Excel tries to open it.

Is there a way to bypass this? My client is annoyed each time because he has
thousands of Word documents to process. He runs it in the middle of the night
only to find out in the morning that there is a dialog box opened asking for
a password.

I'm wondering if there is a parameter that we pass to the Open method of the
Excel object in VBA.


Thanks in advance
 
T

Tim Williams

The Word "Open" method has a "PasswordDocument" parameter you can use to
supply the password.

Tim
 
R

Ray C

Hi Tim,

I solved the problem. I was making a call to the objWord.Unprotect method
which is why Word was asking for the password.

thanks for your help
 

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