PDA

View Full Version : After user clicks 'Notify', do this



drawingblank
11-27-2022, 05:24 PM
Hi,

I have an excel (365) file in a share folder. The file has the 'Read only recommended' when opening. Is there a way to detect when a user clicks on the 'Notify' option and the macro will action a segment of codes? eg

Private Sub Workbook_Open()
If userclicks.notify then
do this
Else 'when user clicks Read only
end if
End Sub

Thanks

georgiboy
11-28-2022, 03:19 AM
Not sure about the 'Notify' button but you can ask if the file is read only within a 'Workbook Open' sub:


Private Sub Workbook_Open()
If ThisWorkbook.ReadOnly = True Then
MsgBox "File is read only"
End If
End Sub

drawingblank
11-29-2022, 04:21 PM
Thanks Georgiboy but the ReadOnly is not what I'm after.