PDA

View Full Version : Solved: Macro to Email Excel workbook



K. Georgiadis
04-29-2007, 05:23 PM
When I searched this topic, I found some 500 threads most of which were not remotely applicable. Here's what I'm trying to do:

I am sending a 4-worksheet workbook with blank forms to 50 different people, asking them to complete them and return them to me by email. I want to assign a macro to a button which:

1) starts the File>Send to>As Attachment routine
2) fills in my email address in the "To" line of the MS Outlook email screen
3) sends the email with the attachment to me

Is there a way to automate this process, so that the users do not have to figure out how to do it and/or to look for my email address>

Many thanks!

geekgirlau
04-29-2007, 08:33 PM
ActiveWorkbook.SendMail "MyEmail@whatever.com", "Subject of Email"

K. Georgiadis
04-30-2007, 04:53 AM
Thank you! Will it be sufficient to add a sub name and "end sub" and insert it in a module? I presume that "subject of email" is a standard subject line that I should complete, e.g. "Completed Survey Forms."

feathers212
04-30-2007, 05:34 AM
I have found these links to be extremely helpful:

http://www.rondebruin.nl/sendmail.htm

K. Georgiadis
04-30-2007, 05:46 AM
Thank you both. In the meantime, I checked the code provided by geekgirlau and confirmed that it works like a charm.