+ Reply to Thread
Results 1 to 6 of 6

Autosave macro with time stamp

  1. #1
    Registered User
    Join Date
    07-08-2015
    Location
    Bratislava
    MS-Off Ver
    2013
    Posts
    47

    Autosave macro with time stamp

    Hi guys,

    I have browsed through the threads for this topic, but as Im not really a VBA user, Im lost and would like to ask you for help creating a macro for an autosave.

    I would need an autosave each 8 hours with date/time stamp and specific folder.

    If you need any other info, please let me know

    Many thanks in advance!!
    Lukas

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Autosave macro with time stamp

    Hi there,

    Copy the following code into the "ThisWorkbook" VBA CodeModule of the workbook you want to backup, and see if it does what you need:


    Please Login or Register  to view this content.
    The highlighted values can be altered to suit your own requirements.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    07-08-2015
    Location
    Bratislava
    MS-Off Ver
    2013
    Posts
    47

    Re: Autosave macro with time stamp

    Hi Greg,

    I`ve some questions:
    - does the file needs to be opened, so that it works on the 8 hours basis?
    - Im getting an error...attached right at the beginning of the code
    - so that I can check it and not wait x hours, can i set the time interval for e.g. 0.1 hours?

    Thanks!
    Lukas
    Attached Images Attached Images
    Last edited by Lugashz; 11-25-2015 at 03:53 AM.

  4. #4
    Registered User
    Join Date
    07-08-2015
    Location
    Bratislava
    MS-Off Ver
    2013
    Posts
    47

    Re: Autosave macro with time stamp

    Quote Originally Posted by Lugashz View Post
    Hi Greg,

    I`ve some questions:
    - does the file needs to be opened, so that it works on the 8 hours basis?
    - Im getting an error...attached right at the beginning of the code
    - so that I can check it and not wait x hours, can i set the time interval for e.g. 0.1 hours?

    Thanks!
    Lukas
    ..I have handled the error with Option Explicit (I have moved it to the top) , but getting a different error... which I cant handle :/
    Attached Images Attached Images

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Autosave macro with time stamp

    Hi again,

    1. Remove the "Sub autosave()" statement completely.

    2. You can use whatever value you want for the dINTERVAL_HOURS constant (it is declared as being of type Double, so it does not have to be an integer value). Use a value of 0.000694 (i.e. 1 / 24 / 60) to create a backup copy at one-minute intervals.

    3. Timing starts as soon as the workbook is opened. When the specified time interval has elapsed, a backup copy will be created.

    4. If the workbook (but NOT Excel) is closed, it will be re-opened automatically when the specified time interval has elapsed. If Excel itself is closed the timing process will be stopped and the backup copy will not be created.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  6. #6
    Registered User
    Join Date
    07-08-2015
    Location
    Bratislava
    MS-Off Ver
    2013
    Posts
    47

    Re: Autosave macro with time stamp

    Hi Greg,

    after your explanation of how should it work, I think I need a different approach.

    Is there any chance to make a back up copy at specified time even if the workbook is closed?

    BTW - if I delete the "Sub autosave()" statement, the macro name disappears from my macro list.

    Thanks again,
    Lukas

+ 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] Time Stamp Macro with Offset
    By rhapsody9 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2015, 05:25 PM
  2. Computer time stamp -> excel time stamp
    By j.petrut in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-27-2014, 05:49 PM
  3. Time stamp, macro help!!
    By pasikowskij in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2013, 01:41 PM
  4. [SOLVED] Time stamp via macro
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-20-2013, 04:04 PM
  5. Cannot get time stamp macro to work
    By rp1783 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2012, 08:24 PM
  6. Time Stamp Macro
    By AJSchwayze in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-20-2009, 05:49 PM
  7. [SOLVED] Time Stamp for specific macro..
    By Murph in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2005, 02:05 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