ThisWorkbook.ChangeFileAccess Mode:=xlReadOnlyĮdit the code so that it is your username. If Application.UserName "YourUserName" Then Select ThisWorkbook for the file you wish to make Read-only.Įnter the VBA code below into the code window as shown above: Private Sub Workbook_Open() To enter the Visual Basic Editor press ALT+F11. The user must open the file as read-only unless they have the password.īy using a Macro, it is possible to set the file to read-only when the file is opened. This is certainly more stringent than the non-password option. Therefore, anybody who really, really wants to could get access to your document. Passwords entered using this method are not encrypted and can be cracked. If you set a password to open the document the users will not be able to open the file without a password. It is important that the password is only set for modifying the document. Using the same method as described above, a password can be entered. Save the file as “read-only” with a password The file will be opened, but not as read-only. The biggest issue with this option is that the user can click ‘No’. When the file is opened, a message is displayed asking the user if they wish to open as read-only. The Save As window will appear.įrom the Save As window click Tools -> General Options…įrom the General Options window select the r ead-only recommended option. To use this feature, click File -> Save As. There is a setting to save the file as r ead-only recommended. In this post, we will explore some of the options available. However, the real question they were asking turned out to be “How can I make my workbook read-only for everybody but me”. I was recently asked this question – “How can I make my workbook read-only?”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |