+ Reply to Thread
Results 1 to 4 of 4

how to run a .bat file at specified date

  1. #1
    Registered User
    Join Date
    05-25-2014
    Location
    ATHENS GREECE
    MS-Off Ver
    2007
    Posts
    58

    how to run a .bat file at specified date

    good afternoon all....could someone please assist? here is the case...
    i got a macro within a xl file...and another script saved as .bat (like myscript.bat )....
    what i need? i need to run this myscript.bat through th excel macro within a specific date......lets say 01/01/2016
    could someone help me?

    many thanks!!!
    Still proud to be a Greek.....

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,411

    Re: how to run a .bat file at specified date

    Why do you need to run it through Excel. If you have a batch file that you need to schedule, why not just use Windows Scheduler? Either way, you can use Windows Scheduler to load the Excel Workbook which, in turn, would use the Workbook Open event handler to run your Excel VBA macro.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-25-2014
    Location
    ATHENS GREECE
    MS-Off Ver
    2007
    Posts
    58

    Re: how to run a .bat file at specified date

    well...i'd like not to involve many programs to do the whole work..as far as i got the macro set to run,would be (in my opinion..) easier to add some more functions..like this .bat file............any other ideas?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,411

    Re: how to run a .bat file at specified date

    You could use Application.OnTime to schedule the macro to run and load the batch file. So, if you're ok with having Excel running 24 hours a day, 7 days a week, that'll probably work.

    That said, I know you have to keep track of OnTime schedules and use the exact time to stop them, so maybe it stores something somewhere, maybe in the Registry, and it can wake Excel up, open the workbook, and run the macro.

    Just seems a bit of an overhead when you have a built in tool to schedule tasks. Still: your choice.

    I guess you'll have to experiment with a date and time a little less distant.


    Regards, TMS

+ 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. Open File With file name has format date and time and copy sheets in it
    By stryka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2015, 06:01 AM
  2. [SOLVED] Saving MASTER file, automatically remove part of file name and append current date?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2014, 08:13 AM
  3. Replies: 0
    Last Post: 08-05-2014, 12:46 PM
  4. check if file exists and opening it based on file date
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-26-2014, 03:45 AM
  5. Macro to Download csv file from a dynamic date based url to a specified file location
    By srimani202002 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2014, 07:17 AM
  6. Finding File Creation date, saved date and last modified date
    By david systems in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2013, 05:49 PM
  7. Macro to save Excel file with date and time in the file name?
    By sonic_d_hog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2006, 02:00 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