Hi there. Can I use vba to suppress the "read-only ,notify, cancel" message box when the read only file (which is being opened by other user) is opened by a another user? I want a tailor-made message box is used instead.
Hi there. Thanks for your reply. However, I have tried your advice but the message box still pops up if the file is opened by someone. I placed the expression in the thisworkbook module as follows:
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.DisplayAlerts = True