receive an automatic Email notification when excel sheet is saved


New Member
Apr 6, 2016

i have an excel sheet on the shared network and a some employee can edit and save this sheet, so i need a VBA macro to send me an automatic email notification to my Email when the sheet is saved.
i think its possible possible?
it will be great if i can know who saved it and when.
im not experienced with VBA so please give me simple steps to follow to make this works.

Thanks a lot for you help and thanks in advance


Well-known Member
Jun 13, 2014
Office Version
Rich (BB code):
Private Sub Workbook_AfterSave(ByVal Success As Boolean)

Dim OutApp As Object, OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

strbody = "The workbook " & ThisWorkbook.Name & " was saved at " & Format(Now, "h:mm AM/PM") & " by user " & Application.UserName

On Error Resume Next
With OutMail
    .To = ""
    .CC = ""
    .BCC = ""
    .Subject = "Workbook " & ThisWorkbook.Name & " saved."
    .Body = strbody
    'You can add a file like this
    '.Attachments.Add ("C:\test.txt")
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

End Sub
You can change the blue parts. To use this code open the VBA Editor (ALT+F11) and on the left side find your project name and double-click on the "ThisWorkbook" object. Now paste the code into the white space to the right.
Last edited:

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...