|
-
Apr 28th, 2011, 04:38 PM
#1
Thread Starter
New Member
Sending emails specific date with excel and cdo
I have an excel spreadsheet with a list of resources names (A2:A25), Email list (B2:B25) start dates (C2:C25) and a message concerning their task.(D2 25) I want to trigger and event that sends an email three days before the event date. I have done this with limited success going through outlook. Would rather use cdo and skip Outlook from what I have read. The workbook could remain open. This could run on either and xp machine or a server 2003. Would appreciate your help.
-
Apr 29th, 2011, 06:34 AM
#2
Re: Sending emails specific date with excel and cdo
you could run a daily windows scheduled task, that can run a vbs script (or vb app), to automate the specific workbook (opened or closed) and send the emails as required
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 29th, 2011, 09:34 AM
#3
Thread Starter
New Member
Re: Sending emails specific date with excel and cdo
Using the scheduled task sounds like the right approach to take. Do you have a vb script available that would work for what I am wanting to accomplish?
Thanking you in advance
-
Apr 29th, 2011, 04:30 PM
#4
Re: Sending emails specific date with excel and cdo
Do you have a vb script available that would work for what I am wanting to accomplish?
no, but it would be fairly basic
use getobject to automate the specific workbook
vb Code:
set mybook = getobject(fullpath\filename) set sht = mybook.sheets(1) for each c in sht.range("c2:c25") if datediff("d", date, c) = 3 then ' 3 days, may require reversal of date and c ' send email end if next
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
May 1st, 2011, 09:43 PM
#5
Thread Starter
New Member
Re: Sending emails specific date with excel and cdo
Thank you for the quick response. Used outlook and did get it to work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|