Email from within Excel

  • Thread starter Thread starter Kenneth
  • Start date Start date
K

Kenneth

I have a DDE link in a worksheet. Once the cell with the DDE link
reaches a certain value I would like to send an automated email via my
email software (outlook or outlook express).

My gues it could be done with a macro that runs every minute but I do
not know how to write it.

1. How can I be sure the macro will run with a given interval?
2. How do I send email from within excel?

Please post here or send email to (e-mail address removed)

Thanks!
Ken
 
Kenneth,

I use something like this:
This does not use a refernce.
With a refernce to Otlook 2000 the last couple of lines of code will
work fine (if you have Outlook 2000 then use its VBE for help).

Set objOutlook = CreateObject("Outlook.Application")
Set EmailMessage = objOutlook.CreateItem(olmailitem)

With EmailMessage
.To = e-mail address
.CC = e-mail address
.Subject = "Title "
.Body = "Dear etc. etc."
.Attachments.Add "<filepathway>", 1
.Display
.Importance = olImportancelow
End With

On Error Resume Next
ActiveInspector.WindowState = olNormalWindow 'error if in Otlook
97
On Error GoTo 0

Regards
J
 
Back
Top