LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default AUTOMATICALLY SENDING EMAIL VIA A MACRO

Good afternoon excel Gurus,

I currently have a macro button for when pressed it saves the excel sheet
and automatically sends emails to 2 other users in the company to say this
excel sheet is ready for review.

What i now need to happen is when the manager opens this excel sheet I am
going to create an 'Approval' button so when pressed is will say:

Are you sure you want to approve this PIP? Click yes, save as to a specific
location location detailing a cell reference B10 for the name of the file,
click no it will automatically reply to the person who submitted this excel
workbook saying plese review your PIP as it as been declined.

Below you will see my current code for this to work:

Sub save()

ActiveWorkbook.save

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

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

strbody = "PIP" & " for " & Sheets("PROFIT IMPROVEMENT
PLAN").Range("B10").Value & " " & _
Sheets("PROFIT IMPROVEMENT PLAN").Range("B11").Value & " " & "Ready For
Review"

On Error Resume Next
With OutMail
.To = ; "
.CC = ""
.BCC = ""
.Subject = "PIP Ready For Review"
.Body = strbody
.Send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Email - Sending to email addresses in cell Brice Excel Programming 2 January 26th 09 07:28 AM
disable spell check whilst automatically sending email from Excel RocketRod Excel Worksheet Functions 0 February 10th 08 11:02 PM
automatically sending workbook daily to email recipient Diane Excel Programming 1 November 8th 06 05:38 PM
Sending Email through a macro rojobrown Excel Worksheet Functions 5 October 12th 06 08:17 PM
Sending an email from a macro sungen99 Excel Programming 1 May 5th 04 07:18 PM


All times are GMT +1. The time now is 08:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"