I have created an Excel 2013 workbook that users can modify if they know the password, or can view as read only. However, when anyone opens the file, they first see this dialog box asking them to either choose Read-Only or to enter the password.
Dialog Box.png
Is there any available VBA code that will skip this dialog box and automatically open the workbook as read-only, such that the user doesn't need to face any dialog boxes and can get straight to the Workbook as usual? The dialog box I am talking about is titled "Password" and states "{Document Name} is reserved by {Author} Enter password for write access, or open read only." The dialog box appears on the default gray Excel background and is a rather uninviting window if I need to share this workbook with a client. I'd like to move past this and get straight to the contents of the Workbook as read-only.
I have seen the following bits of code. Turning off alerts does not work, while the first block of code will automatically ensure the Workbook is always read-only, but still does not remove the dialog box:
Private Sub Workbook_Open()
If Not ActiveWorkbook.ReadOnly Then _
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly, WritePassword:="admin"
End Sub
(From this thread: https://www.mrexcel.com/forum/excel-...essagebox.html)
Application.DisplayAlerts = False
(From this thread: https://stackoverflow.com/questions/...n-as-read-only)
Neither of these are what I'm looking for.
Thanks for your help!
Bookmarks