Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Email trigger
Is there a way to trigger an email if a cell in a worksheet becomes e.g.
negative? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why does using @SUM in EXL 2002 trigger an O/L "new" email ? | Excel Worksheet Functions | |||
macro trigger | Excel Discussion (Misc queries) | |||
trigger help | Excel Worksheet Functions | |||
trigger problem | Excel Discussion (Misc queries) | |||
Can you set a "trigger" in excel to send an email? | Excel Worksheet Functions |