Unprotecting a Workbook before exiting

  • Thread starter Thread starter iperlovsky
  • Start date Start date
I

iperlovsky

Does anyone know what line of VB code would unprotect the workbook before
closing the file - such that the next time you open it you are not prompted
for a password.

Thanks,
 
Hi
Activeworkbook.Unprotect Password:="whatever"
regards
Paul
 
I think I need to restate my objective. I need to remove/disable/change the
workbook password from "x" to "". In other words, when I close the workbook
after running the macro and reopen it, I will not be prompted for a password
to enter the workbook.
 
Hi
Activeworkbook.Unprotect Password:="x"
Activeworkbook.Protect Password:=""
Activeworkbook.Unprotect Password:=""

regards
Paul
 
This does not work because I am still prompted for a password when I open the
workbook. Anyway to disable the workbook password protection (under the
tools-options-security menu) rather than change the password to be nothing?
 

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

Back
Top