Forum Discussion
ZennaVB
Feb 08, 2024Copper Contributor
How to password protect Excel document for specific people
Hello Excel experts,
Simple question: Is it possible to protect an Excel worksheet with a password, but exclude a group of users from filling in a password. I can't find this option and can't find it on the web, so this is my last hope.
If this is not possible I will have to protect the Excel worksheet in a different way.
Thanks in advance,
Zenna
ZennaVB I would probably solve it like so:
- Password protect the file (I assume this is the password to open the file in edit mode, so without the password, you can open the file, but it will be read-only)
- In a separate Excel file which only the user has access to, write a macro like below.
- If the daily user wants to edit the file, simply open that file with the macro and click the button to open the file to edit.
- Other users can just open the file, it will open read-only
See the video on the save-as, attached a sample workbook with a macro in the ThisWorkbook module which needs editing to update the file location and name and the password "test".
- JKPieterseSilver ContributorDepends. What exactly are you trying to achieve?
- ZennaVBCopper Contributor
Hello JKPieterse ,
I have a user in our tenant that has created an Excel worksheet that needs to be stored on a network share in our Company. When this user is not in the office (for any reason whatsoever), other colleagues should have the option to open the Excel worksheet. Since the first user is affraid that data in the Excel sheet will be changed, he wants to protect it with a password. He works in this file daily, and is looking for a solution so that he does not need to fill in the password everytime he opens the file, but this should be the case for other users.
If this is not possible, I would just advice him to protect the Excel sheet with a password. Only downside to this is the fact he needs to fill in the password every single day.
- JKPieterseSilver Contributor
ZennaVB I would probably solve it like so:
- Password protect the file (I assume this is the password to open the file in edit mode, so without the password, you can open the file, but it will be read-only)
- In a separate Excel file which only the user has access to, write a macro like below.
- If the daily user wants to edit the file, simply open that file with the macro and click the button to open the file to edit.
- Other users can just open the file, it will open read-only
See the video on the save-as, attached a sample workbook with a macro in the ThisWorkbook module which needs editing to update the file location and name and the password "test".