password protect all files in a folder

  • Hello

    I want to password protect all excel files in a folder with different password,

    code should go to the url in the filename column and assign password in the password column

    let say for file path in Cell B2 should be assigned with password in e2 file path in Cell B3 should be assigned with password in E3...etc

    i tried the below code , but couldnt able to get

  • Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post

    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.

    How to use code tags

    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


  • maybe this will be better

  • Pleased to help.

    Post back if you need further help.

    Visit my web site,, for more examples and some helpful articles.