Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet I would like to automatcially email itself upon opening.
It will always go to the same address. I use MS Outlook and Excel 2003. Is this possible? I am comfortable w/ Excel and Outlook put am not an accomplished programmer. Is there help out there? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rod,
Put the code below into a module (making changes as needed to the subject, address, and message), set a reference to MS Outlook using Tools | References.... and use the open event or an auto-open macro to run it. HTH, Bernie MS Excel MVP Sub EmailThisWorkBookNow() Dim ol As Object Dim myItem As Outlook.MailItem Dim myMsg As String Dim myAtts As Outlook.Attachments Set ol = CreateObject("outlook.application") myMsg = "Hi Rod," & Chr(10) & Chr(10) myMsg = myMsg & "Here's that stupid file.... AGAIN!" & Chr(10) & Chr(10) myMsg = myMsg & " Rod" & Chr(10) Set myItem = ol.CreateItem(olMailItem) myItem.to = " myItem.Subject = "Subject Line" myItem.Body = myMsg Set myAtts = myItem.Attachments myAtts.Add ThisWorkbook.FullName myItem.Send Set ol = Nothing End Sub "Rod" wrote in message ... I have a spreadsheet I would like to automatcially email itself upon opening. It will always go to the same address. I use MS Outlook and Excel 2003. Is this possible? I am comfortable w/ Excel and Outlook put am not an accomplished programmer. Is there help out there? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
freeze more than one row within a spreadhsheet | Excel Discussion (Misc queries) | |||
Help with automatically opening another worksheet | Excel Discussion (Misc queries) | |||
Opening an add-in automatically | Excel Worksheet Functions | |||
how do I convert an excel file to microsoft works spreadhsheet? | Excel Discussion (Misc queries) | |||
Loan Amoritization Spreadhsheet Issue...please help | Excel Worksheet Functions |