Auto notify or mail when Excel sheet updated.
Solved/Closed
Related:
- Email notification when excel spreadsheet is updated
- How to generate email notifications for Excel updates - Guide
- What is light in whatsapp notification - Guide
- No email no password - Guide
- Network notification - Guide
- Hotmail email - Guide
4 responses
Hi, I just had this problem and poked around until I found a solution, so here I am passing it on to you. This will automatically send an email to any address/addresses whenever the workbook is saved. The only problem I have with it is that if you save it, you get the prompt, and when you close, excel automatically prompts you again. As long as you don't do a redundant save then you won't get a redundant auto email notification :)
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim answer As String
answer = MsgBox("This is where you put the text to prompt the user if he wants to save or not" vbYesNo, "here is the title of that box")
If answer = vbNo Then Cancel = True
If answer = vbYes Then
'open outlook type stuff
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
'newmsg.Recipients.Add ("Name Here")
newmsg.Recipients.Add ("sampleemailaddresshere@email.com")
'add subject
newmsg.Subject = "Subject line of auto email here"
'add body
newmsg.Body = "body of auto email here"
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "insert confirmation box test here", , "title of confirmation box"
End If
'save the document
'Me.Worksheets.Save
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim answer As String
answer = MsgBox("This is where you put the text to prompt the user if he wants to save or not" vbYesNo, "here is the title of that box")
If answer = vbNo Then Cancel = True
If answer = vbYes Then
'open outlook type stuff
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
'newmsg.Recipients.Add ("Name Here")
newmsg.Recipients.Add ("sampleemailaddresshere@email.com")
'add subject
newmsg.Subject = "Subject line of auto email here"
'add body
newmsg.Body = "body of auto email here"
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "insert confirmation box test here", , "title of confirmation box"
End If
'save the document
'Me.Worksheets.Save
End Sub
Sep 1, 2009 at 07:32 AM
Hey its working fine, I have downloaded the Advanced Security Option from MAPI lab so it is not asking anything and able to send mail automatically.
Thanks a lot
Sep 29, 2009 at 12:58 AM
I am trying to create an excel sheet which has some data like meet HR on the 29th sept and so I need to recieve a mail reminder saying please meet HR. I am using Outlook express . Actual work of the excel sheet is to send email reminders about pending RFQ.
So please can u help me with the same.