#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Email trigger

Is there a way to trigger an email if a cell in a worksheet becomes e.g.
negative?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Email trigger

You can use a Worksheet Change event on the cell to run code to send an
email. Here is info on events and sending mail

http://www.cpearson.com/excel/Events.aspx
http://www.j-walk.com/ss/excel/tips/tip86.htm

As I recall, the email part can be a bit tricky. I've not done much of it
so can't give an example.

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As
String, _
ByVal nShowCmd As Long) As Long

Sub SendEmail()

'Example for Outlook Express
'In Excel 2002 I can use around 600-700 characters
Dim msg As String, cell As Range
Dim Recipient As String, Subj As String, HLink As String
Dim Recipientcc As String, Recipientbcc As String

Recipient = "

'Defining subject of email
Subj = "Your subject"


msg = "Your message"

HLink = "mailto:" & Recipient
HLink = HLink & "?subject=" & Subj
HLink = HLink & "&body=" & msg

ActiveWorkbook.FollowHyperlink (HLink)
Application.Wait (Now + TimeValue("0:00:03"))
Application.SendKeys "%s"

End Sub


I'm not exactly sure what the first 4 lines do, so you probably ought to
figure that out before you use this regularly. In addition, I *think* you
may need to have Outlook open to run this.
--
HTH,
Barb Reinhardt



"Ash D" wrote:

Is there a way to trigger an email if a cell in a worksheet becomes e.g.
negative?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Email trigger

See also
http://www.rondebruin.nl/mail/change.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Barb Reinhardt" wrote in message
...
You can use a Worksheet Change event on the cell to run code to send an
email. Here is info on events and sending mail

http://www.cpearson.com/excel/Events.aspx
http://www.j-walk.com/ss/excel/tips/tip86.htm

As I recall, the email part can be a bit tricky. I've not done much of it
so can't give an example.

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As
String, _
ByVal nShowCmd As Long) As Long

Sub SendEmail()

'Example for Outlook Express
'In Excel 2002 I can use around 600-700 characters
Dim msg As String, cell As Range
Dim Recipient As String, Subj As String, HLink As String
Dim Recipientcc As String, Recipientbcc As String

Recipient = "

'Defining subject of email
Subj = "Your subject"


msg = "Your message"

HLink = "mailto:" & Recipient
HLink = HLink & "?subject=" & Subj
HLink = HLink & "&body=" & msg

ActiveWorkbook.FollowHyperlink (HLink)
Application.Wait (Now + TimeValue("0:00:03"))
Application.SendKeys "%s"

End Sub


I'm not exactly sure what the first 4 lines do, so you probably ought to
figure that out before you use this regularly. In addition, I *think* you
may need to have Outlook open to run this.
--
HTH,
Barb Reinhardt



"Ash D" wrote:

Is there a way to trigger an email if a cell in a worksheet becomes e.g.
negative?


Reply
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
Why does using @SUM in EXL 2002 trigger an O/L "new" email ? Retiree Excel Worksheet Functions 3 April 17th 07 08:43 PM
macro trigger Leslieac Excel Discussion (Misc queries) 3 February 2nd 06 09:08 PM
trigger help climax Excel Worksheet Functions 1 February 2nd 06 04:39 PM
trigger problem climax Excel Discussion (Misc queries) 1 February 2nd 06 12:39 AM
Can you set a "trigger" in excel to send an email? Debbi Excel Worksheet Functions 1 January 20th 06 03:25 PM


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

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

About Us

"It's about Microsoft Excel"