Protect/Unprotect Sheets

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

Guest

I am trying to write code to 1st unprotect a sheet, then refresh all links, then re-protect the sheet. Everytime it seems to say I can't refresh because the sheet is protected. How can I have it do the above in that order so it unprotects, refreshes, and then protects again?
Thanks
 
This will protect the Active sheet with a password:
ActiveSheet.Protect "mypassword"

This will unprotect the Active sheet with a password:
ActiveSheet.UnProtect "mypassword"

Remove "mypassword" and it will protect/unprotect without a password.

hth
--

steveB

(Remove 'NOSPAM' from email address if contacting me direct)


Deeds said:
I am trying to write code to 1st unprotect a sheet, then refresh all
links, then re-protect the sheet. Everytime it seems to say I can't refresh
because the sheet is protected. How can I have it do the above in that
order so it unprotects, refreshes, and then protects again?
 

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