Hi all,

I have a protected file.

When users open as read only and closes the file, I want the file to close without saving any changes AND prevent the "Do you want to save" message from prompting as well.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    If ThisWorkbook.ReadOnly = True Then
        Application.EnableEvents = False
        Cancel = True
    End If
End Sub
I tried the above code, and even if i didnt make any changes when i open the file in read-only, the message will still prompt when I closes the file.

Appreciate if nyone can help.

Thank you!