Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rod Rod is offline
external usenet poster
 
Posts: 108
Default Automatically EMailing a Spreadhsheet Upon Opening

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Automatically EMailing a Spreadhsheet Upon Opening

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
freeze more than one row within a spreadhsheet Mari Excel Discussion (Misc queries) 5 April 28th 23 11:42 AM
Help with automatically opening another worksheet Kirby Excel Discussion (Misc queries) 4 October 21st 08 02:31 PM
Opening an add-in automatically ismae Excel Worksheet Functions 0 December 27th 07 05:16 PM
how do I convert an excel file to microsoft works spreadhsheet? BigCarol Excel Discussion (Misc queries) 1 October 29th 07 12:56 PM
Loan Amoritization Spreadhsheet Issue...please help anonymous Excel Worksheet Functions 3 February 7th 06 01:20 AM


All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"