+ Reply to Thread
Results 1 to 3 of 3

VBA to run auto email code when date becomes yesterday

  1. #1
    Registered User
    Join Date
    04-17-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2013
    Posts
    2

    Red face VBA to run auto email code when date becomes yesterday

    Hi guys,

    I'm pretty new to VBA, however all is well so far - i need to see if anyone can help?

    In short i have the code to convert my workbook to pdf and auto email however what i'm struggling with is finding "todays" date code to initalize that function, a true neewbie question i guess although I've had a look around on the forums with no joy as yet of course by the title i want this to run at either 00:00:01 always or today -1

    The workbook will be always open...

    Any help would be much appreciated!

    cheers

  2. #2
    Forum Contributor
    Join Date
    02-28-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    187

    Re: VBA to run auto email code when date becomes yesterday

    The function you want is just ' = Date'. You can't run at = today-1, as that condition can never be true by reference to today's date. I think it's safer to just require it to run at 00:01:00.

    The main problem I fear you will encompass however is that outlook will require you to alow a macro to send an email, and it will require this every time. You may be able to avoid this by setting the security on Outlook to low, but this isn't always a feasible method to follow, particularly on a work computer.

  3. #3
    Registered User
    Join Date
    04-17-2014
    Location
    Manchester
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: VBA to run auto email code when date becomes yesterday

    Thanks for your reply, i now have this working using applicationontime and VB Day for weekly monthly is also working using date value...on the outlook front it will be on a work machine but the outlook account on that machine will always be open..i've been testing on a work machine using the work accounts and all is well

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula to return a True/False if date equals yesterday's date
    By abbeycrombie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-17-2013, 11:31 AM
  2. reference column date (yesterday) to get Month(Date) for copy paste
    By jukabub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-09-2013, 03:52 AM
  3. Check date, auto email
    By JonathanB2 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-12-2013, 11:17 AM
  4. auto email date coming due
    By bfredricksen in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-18-2013, 11:46 AM
  5. Modity on current code to prompt due date & auto email
    By cyee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-05-2013, 04:00 AM

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