Macro to Protect workbook using a password

P

PCLIVE

Does anyone know how I can do this?

I know this is a little unorthodox, but I currently have a macro that
will unprotect a workbook including a password. The line is as follows:

ActiveWorkbook.Unprotect (password)

I also want a macro that will do just the opposite, including the password.
Is this possible? I've tried the following with no luck.

ActiveWorkbook.Protect (password), Structure:=True, Windows:=True


Thanks,
Paul
 
J

J.E. McGimpsey

You got two replies when to your identical post on Tuesday. If they
weren't suitable, please explain why not.

If you didn't see them, you can always see your posts and any
replies using the Google archives (it takes 4-8 hours to show up
after posting to the groups):

http://google.com/advanced_group_search?q=group:*excel*

Use your email address in the Author search field.
 

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