Unprotect an object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have Access 97 and we have a database that runs code to open a password
protected Excel workbook. The password is coded like this:

Set objBook = objApp.Workbooks.Open(UDFPDIR & strFile, , , , "password")

This works fine. What I want to do is unprotect the workbook before
closing. So we can open the files in the future without having to enter
password. Would this be correct?

objBook.unprotect("password") 'new code
objBook.close
objApp.Quit

Don't I need a statement which saves the changes?

Thanks
 
The Unprotect statement looks correct.

Change the Close statement to:

objBook.Close True

to save the Workbook after unprotecting it.
 
Back
Top