+ Reply to Thread
Results 1 to 5 of 5

Application.ontime to stop at a certain time

  1. #1
    Registered User
    Join Date
    07-21-2014
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    4

    Application.ontime to stop at a certain time

    Hello All


    This is my first post, this website has helped my many times. I have a code that i need emailed out every 30min and it is currently working fine it updates my worksheets and them pastes data into an email and sends it out. The problem is i cant get it to stop. I have another VBA that creates a query to a download link and then i just have to refresh all to update data. The link for the query only stays active for 24hrs so i have to change it everyday and then run the VBA to start the emails. The code is posted below i just need the emails to stop sending at 11:59pm on the day it is started or have it set only to run a certain amount of times and then stop. Any help would be greatly appreciated code is pasted below



    Please Login or Register  to view this content.



    Thank you

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Application.ontime to stop at a certain time

    You could try

    Please Login or Register  to view this content.
    Which should end the loop close to midnight.
    Martin

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Application.ontime to stop at a certain time

    Try adding this to the bottom of your code.

    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    07-21-2014
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Application.ontime to stop at a certain time

    Thank you so much for the quick response i will try now and let you know in the morning

  5. #5
    Registered User
    Join Date
    07-21-2014
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Application.ontime to stop at a certain time

    they both worked thank you very much!!

+ 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] Stop a VBA Timer (Application.OnTime) on Separate Button Click.
    By KomicJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2018, 01:05 AM
  2. [SOLVED] Run Macro at set time - Stop them when workbook is closed. Application.OnTime
    By Si-Phy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2017, 06:14 AM
  3. VBA - Application.Ontime Cancel Fails to Method 'ONTIME' of Object 'Application'
    By LordAzuRa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2016, 03:21 PM
  4. How to Stop Application.Ontime from Running
    By shakira in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-24-2015, 08:14 AM
  5. Application.ontime, Running time increasing.
    By olle3770 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2014, 07:24 AM
  6. Stop application.ontime
    By Onweerwolf in forum Excel General
    Replies: 5
    Last Post: 09-01-2014, 11:21 AM
  7. Can Application.OnTime be stopped at a specified time
    By rhudgins in forum Excel General
    Replies: 4
    Last Post: 04-14-2011, 05:38 PM

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