Hi,
I need your help with following task.
I have shared file, for which few users have special right and can modify the data inside it. It works this way that Workbook_open recognise who is opening it by USERNAME and give special permisses or opening as read only.
But I would like to modify one thing. When SPECIAL user will be opening the file during the moment when its already opened by other SPECIAL user I would like to put a msg and open as read only. With second part there should be a problem, but I dont know how to handle with the begining.
Thanks a lot
Max
I need your help with following task.
I have shared file, for which few users have special right and can modify the data inside it. It works this way that Workbook_open recognise who is opening it by USERNAME and give special permisses or opening as read only.
But I would like to modify one thing. When SPECIAL user will be opening the file during the moment when its already opened by other SPECIAL user I would like to put a msg and open as read only. With second part there should be a problem, but I dont know how to handle with the begining.
Code:
If Application.USERNAME = "000" Or Application.USERNAME = "aaa" Or Application.USERNAME = "bbb" Or Application.USERNAME = "ccc" Then
ThisWorkbook.Protect Structure:=False, Password:=MyPassword
ThisWorkbook.Sheets("C").Unprotect Password:=MyPassword
ThisWorkbook.Sheets("S").Visible = True
Else
ThisWorkbook.ChangeFileAccess xlReadOnly
End If
Thanks a lot
Max