How to add the Mail Notification for one Macro

Hi,

We have a macro which will use many sheets to prepare a final report . However at the end of the completion, it should trigger a mails as completed. How to add that ?

Thanks
Venkatesh.
venkatesh SarivisettySenior Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
Hi,

pls try
Sub Mail_Notification()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim strbody As String

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

    strbody = "Hi, " & vbcrlf &"The process is finished" & vbcrlf & vbcrlf & "Regards"

    On Error Resume Next
    With OutMail
        .To = "john.doe@mymail.com"
        .CC = ""
        .BCC = ""
        .Subject = "This is the Subject"
        .Body = strbody
        .Display   'or use .Send
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

Open in new window


in your code

Sub yourMacro()
'First your code
Call Mail_Notification
End Sub

Open in new window

Regards
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
venkatesh SarivisettySenior Software EngineerAuthor Commented:
Please share the complete code at once and share me. Also where I will kept this one. Because as I told it is using 3 different files. Please advise.
0
Rgonzo1971Commented:
What do you mean?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

venkatesh SarivisettySenior Software EngineerAuthor Commented:
I mean to say, where I need to copy this becoz it is using so many sheets, how to make as a seperate one. Please advise.

Thansk
Venkatesh.
0
Rgonzo1971Commented:
Sorry can't help further
0
TracyVBA DeveloperCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Rgonzo1971 (https:#a42350936)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

broomee9
Experts-Exchange Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.