Private Sub Workbook_Open()
If ActiveWorkbook.ReadOnly = True Then
MsgBox "File already in use ask to close it before modification."
MsgBox "Nothing will be saved!"
End If
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ActiveWorkbook.ReadOnly = False Then
MsgBox "Modifications will be saved"
ActiveWorkbook.Save
End If
If ActiveWorkbook.ReadOnly = True Then
MsgBox "Nothing will be saved!"
ActiveWorkbook.Close
End If
End Sub