Private Sub Workbook_Open()
Dim sUserName As String
Application.DisplayAlerts = False
If ActiveWorkbook.ReadOnly Then
sUserName = "[ " & Sheet2.Range("bd4").Value & " ]"
sMsg2 = "Sorry! This leave plan is now being used by " & vbCrLf
sMsg3 = vbCrLf & " ....Please try again minutes later..."
MsgBox sMsg2 & vbCrLf & " " & sUserName & vbCrLf & sMsg3, vbCritical, "Filed being used"
Application.Quit
ActiveWorkbook.Close
Application.DisplayAlerts = True
Exit Sub
endIf