galmond1010

New Member
Joined
Apr 15, 2019
Messages
21
Is it possible to have an email notification when one of my files is open by another user? I have used MsgBox and With Outmail code before but it was when someone ran my macro. I wasn't sure if it can be done with my file is opened. Thank you in advance.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
There is an open workbook event: In VBA, 2x click "ThisWorkbook" under the sheets name and paste

Code:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Private Sub Workbook_Open()
 With ActiveSheet.MailEnvelope
        .Introduction = "File 123 was opened"
        .Item.To = "myemail@adress.com
        .Item.Subject = "I opened your file"
    'Chose display or send
        '.Item.display
        .Item.send
    End With
End Sub[/FONT]
 
Upvote 0
Just note that they can get around this by disabling Macros/VBA when opening the workbook.

What I have seen some people do is hide and protect the sheet so that no data is shown, by default, and to have code to unhide it in the same Workbook_Open event procedure code. That way, if they do open it with disabling VBA, it is essentially worthless to them, as they will not see anything.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,580
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top