How do I make a workbook read only when opening but allow some people read write access without putting in a password.

ghrek

Active Member
Joined
Jul 29, 2005
Messages
426
Hi

Didn't know if there was an easy way to make a workbook read only when opening but allow some people read write access without putting in a password. Seen where you can do options when saving but it asks for a password and I want work book to open as read/write automatically when a specific person opens it

Any suggestions?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Please paste this in the ThisWorkbook Module
Snag_1c980441.png

VBA Code:
Sub Workbook_Open()
Select Case Application.UserName
    Case "G Hrek", "Second Name", "Third Name" 'add as many names here
        ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
    Case Else
End Select
End Sub
 
Upvote 0
Of course, if they were to disable Macros when they open the workbook, that would totally bypass that procedure, rendering that totally ineffective.

What I have some people do is hide/password protect the data by default, and have the macro first unprotect it. So if they do not enable macros/VBA, they will not be able to see/do anything. So that would help prevent users from "gaming" the system by disabling macros/VBA.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top