+ Reply to Thread
Results 1 to 5 of 5

Run a Macro every 7 days that saves the file in a different folder

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Somewhere, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    19

    Run a Macro every 7 days that saves the file in a different folder

    Hey people,

    There's an excel file*(multiple sheets) that is open almost 24/7 at work. Our back-up system won't back it up b/c it is open. Recently about 4 months worth of data was lost and had to be re-entered. Therefore I need a macro that acts like a back-up system. It should run every 7 days and save a copy of that excel file to a *different folder* than the original is in. A KEY requirement is that every week when it saves it should save under a different name, perferably including the date. However numbering the files is ok. Here is the current name of the file C9 Metalure data tracking - save and close when done and I'd like the copy to be that but with the date in front. Thanks alot guys!

  2. #2
    Registered User
    Join Date
    07-31-2012
    Location
    Somewhere, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run a Macro every 7 days that saves the file in a different folder

    Bump no response

    ---------- Post added at 02:52 PM ---------- Previous post was at 02:52 PM ----------

    Why are there no replies, is this not possible?

  3. #3
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Run a Macro every 7 days that saves the file in a different folder

    You could do this with a Windows scheduled task which runs a VBScript program (not VBA) to save the workbook to a different folder with the current date in the file name.

    Or for a VBA solution, have a look at Application.OnTime - http://www.cpearson.com/excel/OnTime.aspx. Call the StartTimer function on that page from Workbook_Open and call the procedure* which saves the workbook if the current day is Monday (or whichever day you decide) and reschedule for 7 days later. But Excel must be open (not necessarily the workbook in question) for this to work, therefore the scheduled task method is likely to be more reliable and is easier to implement anyway.

    *Use the macro recorder to generate the code for saving to a different folder and file name (code will need to be edited to include the current date in the file name).
    Last edited by Chippy; 08-02-2012 at 06:04 PM.
    Post responsibly. Search for excelforum.com

  4. #4
    Registered User
    Join Date
    07-31-2012
    Location
    Somewhere, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run a Macro every 7 days that saves the file in a different folder

    Hey Chippy,

    Thanks a lot for the response, so below is what I have so far. Can I change the time to be in days or at least hours? b/c I want it to run every week! Also, how would I get it to save the file as the date? right now it has it saving as Book1.xlsm every time? Feel free to make the changes to the code, thanks again.


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-31-2012
    Location
    Somewhere, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run a Macro every 7 days that saves the file in a different folder

    Nevermind, it has been solved. For anyone who is looking for the solution, check my other posts

+ 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