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 fin...
- Feb 08, 2024
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".
ZennaVB
Feb 08, 2024Copper 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.
JKPieterse
Feb 08, 2024Silver 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".
- ZennaVBFeb 08, 2024Copper Contributor
Thanks for your quick reply!
I think I will implement this in our environment, I need to change the Macro since it is redirecting to your user folder that obviously doesn't exist on my desktop.
I think I will manage to fix this in our organisation, thanks for the clear explanation!
- JKPieterseFeb 08, 2024Silver ContributorYes, this is why I mentioned "which needs editing to update the file location and name and the password "test"." 🙂