+ Reply to Thread
Results 1 to 6 of 6

Start Macros every 24 hours

  1. #1
    Forum Contributor
    Join Date
    08-31-2022
    Location
    Swiss
    MS-Off Ver
    365
    Posts
    134

    Start Macros every 24 hours

    Dear members of the forum,

    is it possible to start a macro every 24 hours?
    I would like to make a dynamic dashboard and therefor I need to refresh the data once a day.
    How can I program something like this?
    I have the macro already, I just need to autostart it every day.

    Sorry I'm quite new to VBA/macros, but thank you for your help in advance,

    Best regards,

    David

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: Start Macros every 24 hours

    I do not know how other people solve this, I done this as below.

    - Create VBS file like below:
    Please Login or Register  to view this content.
    edit red according to your path and names

    - set in windows Task Scheduler that this VBS file have to be run every 24 hours.

    And that's all. Works for me.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,155

    Re: Start Macros every 24 hours

    The following macro is used to 'auto save' the workbook each day at 10 seconds past midnight.
    The time can be changed for your purposes ... save 9:30 am ? by editing the time value :

    Application.OnTime TimeValue("09:30:00"), "sveWrkBk"


    Please Login or Register  to view this content.
    Change 'sveWrkBk' to the name of your refresh macro and include your refresh macro separate from
    this macro.

    Look at the attached workbook in the ThisWorkbook module and you will find the following macro that auto
    runs the sveWrkBk macro when the workbook is first opened for the day ...

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Start Macros every 24 hours


    Quote Originally Posted by mrdaave View Post
    I have the macro already, I just need to autostart it every day.
    Why not just 'autostart' it at the workbook opening ?

  5. #5
    Forum Contributor
    Join Date
    08-31-2022
    Location
    Swiss
    MS-Off Ver
    365
    Posts
    134

    Re: Start Macros every 24 hours

    Thank you very much for your help!
    I was able to solve the problem with your inputs

    @Marc L: The problem is that I dont want to start the macro every time I open the workbook (its permanently open), but just to start it every day (at e.g. 12 o'clock)

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,155

    Re: Start Macros every 24 hours

    Glad you have an answer.

+ 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] Count Hours between Start Time & End Time but exclude Break Hours
    By josephteh in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-23-2017, 10:44 AM
  2. Replies: 3
    Last Post: 04-23-2016, 01:42 AM
  3. Replies: 8
    Last Post: 01-31-2016, 10:14 AM
  4. [SOLVED] Adding hours to start time - Business hours/holidays/weekends
    By Thunderer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-21-2014, 01:09 PM
  5. Replies: 0
    Last Post: 04-07-2011, 01:46 AM
  6. Replies: 6
    Last Post: 03-25-2010, 07:50 AM

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