Hello Friends,
I am using the below code which is linked with Workbook open event
I have allowed only 4 users who can access the file & for that I have mentioned there mac addresses in the code. Now what I want is when a new user tries to open the file then it should close which it does but the problem is that the code can be interrupted like pressing the ESC key or control + break key.
Is there any way where I can restrict the user to interrupt the code.
Regards,
Humayun
I am using the below code which is linked with Workbook open event
Code:
Private Sub Workbook_Open()
Application.Calculation = xlCalculationAutomatic
Call show_index_sheet
Sheets("INDEX").Unprotect Password:="merchant"
Sheets("INDEX").Range("A1").Value = GetMACAddress()
If Sheets("INDEX").Range("A1") = "A0:C5:89:28:4A:6A" Or _
Sheets("INDEX").Range("A1") = "50:3E:AA:65:02:2F" Or _
Sheets("INDEX").Range("A1") = "C4:E9:84:17:B3:1B" Or _
Sheets("INDEX").Range("A1") = "14:CC:20:1F:FD:20" Then
Sheets("INDEX").Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="merchant"
Else
ActiveWorkbook.Close savechanges = False
End If
End Sub
I have allowed only 4 users who can access the file & for that I have mentioned there mac addresses in the code. Now what I want is when a new user tries to open the file then it should close which it does but the problem is that the code can be interrupted like pressing the ESC key or control + break key.
Is there any way where I can restrict the user to interrupt the code.
Regards,
Humayun