PDA

View Full Version : Sending Email from Excel



dondark
11-07-2005, 08:33 PM
Hey,

I have a cell or cell range in microsoft excel. I want to automatically send an email to a specified adress with the contents of the email being the cell or cell range.

Can anyone help me do this? The default email application is outlook. But can this be done otherwise?

Thanks,
dondark

Steiner
11-08-2005, 12:08 AM
You could try to modify this KB entry: http://vbaexpress.com/kb/getarticle.php?kb_id=311

As this one uses MAPI it should work with Outlook as well as with MS Mail or another Standard Mail Client.

If you don't want to send the whole workbook, just call it this way:

SendIt "me@here.com", "A new Document", ActiveCell.Value,""

dondark
11-08-2005, 07:36 AM
Thanks a lot, man.

One additional question, if I wanted to run a macro or sub procedure every 15 minutes, how could I do that?

ALe
11-08-2005, 11:33 AM
Public scadenza
Sub DoAction()

MsgBox "Action"
scadenza = Now + TimeSerial(0, 0, 5)
Application.OnTime scadenza, "DoAction"

End Sub

Sub CancelAction()
Application.OnTime earliesttime:=scadenza, Procedure:="DoAction", Schedule:=False

End Sub