Scheduling daily emailing of an excel file

PTProgram

New Member
Joined
May 16, 2003
Messages
33
If I have an excel file that is automatically updated each night and then I want to email it to someone, is done through excel vba or outlook vba? I use office 2003. Ideally, I would like to start saving the file that updates as a html file that will be saved in the same place and then email the html file everyday.

Any ideas?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
See: http://www.rondebruin.nl/sendmail.htm for just about all the tricks you'll need for e-mailing with Outlook/Excel.

As for when you want it to run, you can schedule the event with:
Code:
Private Sub Workbook_Open()
     Application.OnTime TimeValue("15:00:00"), "MyMacro"
End Sub
Change the time to reflect the time that you want the workbook sent and "MyMacro" to the name of the e-mail macro that you create.

The e-mail code will go in a general module, while the Workbook_Open code will go in the ThisWorkbook module.

Hope that helps,

Smitty

EDIT: Typo
 
Upvote 0
Thanks. Looked at the site but unclear if any code actually goes into outlook VBA or is it all in Excel? The actual file is an html file, so not sure how to go about it.
 
Upvote 0
The code goes in Excel VBA and you should be able to send the HTML document by sending after you save it as HTML.

Smitty
 
Upvote 0
Hello! This doesn't seem to work. I know this post is old....maybe something has changed since excel 2013. I'm using 365.
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top