Asked By
arunap
0 points
N/A
Posted on - 10/09/2011
We do not have any task tracking system in place. We usually maintained it through excel and then send it to associated users by email. We want have this process automated and spreadsheet should itself send an email (internet email ids like gmail, yahoo) whenever it gets modified. Can anyone help ?
Answered By
rdbuzz01
0 points
N/A
#89960
Email notification once the excel spreadsheet modified.
just add this macro > Right-click the Worksheet's Name Tab and look for 'View Code' > On the VB window that'll open put this codes>
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Dim answer As String
answer = MsgBox("Put the message for the prompt when it'll ask you to save" vbYesNo, "title of the prompt or 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")
newmsg.Recipients.Add ("thisistheemailsample@email.com")
'add subject
newmsg.Subject = "place the subject for your email here"
'add body
newmsg.Body = "contents of your automail 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
try it. I hope it helps.