+ Reply to Thread
Results 1 to 4 of 4

Code for email alerts from excel isn't working, wrong code possibly?

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    North Wales
    MS-Off Ver
    Excel 2003
    Posts
    3

    Code for email alerts from excel isn't working, wrong code possibly?

    I am trying to set up automated emails to be sent from excel 30 days before staff are due to go on their statutory and mandatory training. I have used this thread as a starting point and it has been a huge help to me.

    http://www.excelforum.com/excel-prog...ication-2.html

    I've tried to change the code to suit the needs of my database, however it doesn't seem to be working.

    I have a column to identify the date they completed the training course, and next to that I have a column with a date when the course is next due.

    Here is the code I have currently:



    Please Login or Register  to view this content.
    I have also attached the database. At the minute I am only working on "Sheet 1" and the first 'due date' column even though there are several sheets and several columns, the idea is to have it on them all, but first it has work! Also each 'due date' column is designated to a different member of staff, would I need to have a different code for every person, indicating a different email address? If so, do I just put it under the above code?

    Thanks in advance.

    Jess
    Attached Files Attached Files
    Last edited by arlu1201; 07-26-2012 at 07:58 AM. Reason: Check my signature on how to use code tags.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Code for email alerts from excel isn't working, wrong code possibly?

    A few questions.
    Did you write this code yourself or are you trying to adapt it to your needs? If so, I think you would be better off starting from scratch.
    When do you want to run this macro? Can you put those peoples emails in the workbook so that you can reference them when needed?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    07-26-2012
    Location
    North Wales
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Code for email alerts from excel isn't working, wrong code possibly?

    I have adapted the code from another example, I don't really know enough about codes to write it myself.
    I'd like the macro to run when I open the file, I think I've already done that though.
    As for the emails, I could include them on the worksheet however as each different column refers to a different member of staff I thought it'd be easier to just put the emails straight into the code?

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Code for email alerts from excel isn't working, wrong code possibly?

    What I meant by the emails in a worksheet was, to create a new worksheet(You could hide it) and put the emails in there. From that you could have the macro search for the recipient and not have to write extra code for each individual. Or , if there was not many people to email to, just include those emails in the macro itself? What are you thoughts? Anyway try this starters. This will email to one person.

    Please Login or Register  to view this content.
    Make sure you test this with your email first. Change this line in the code to represent your email address.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JapanDave; 07-27-2012 at 02:04 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1