SOLVED

How to password protect Excel document for specific people

Copper Contributor

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

5 Replies
Depends. What exactly are you trying to achieve?

Hello @Jan Karel Pieterse ,

 

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.

best response confirmed by ZennaVB (Copper Contributor)
Solution

@ZennaVB I would probably solve it like so:

  1. 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)
  2. In a separate Excel file which only the user has access to, write a macro like below.
  3. 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.
  4. 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".

@Jan Karel Pieterse 

 

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!

Yes, this is why I mentioned "which needs editing to update the file location and name and the password "test"." :)
1 best response

Accepted Solutions
best response confirmed by ZennaVB (Copper Contributor)
Solution

@ZennaVB I would probably solve it like so:

  1. 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)
  2. In a separate Excel file which only the user has access to, write a macro like below.
  3. 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.
  4. 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".

View solution in original post