Updating or Auto Saving a file every hour

Olyn01

New Member
Joined
Mar 12, 2019
Messages
12
Hi! I have an excel file that is saving every day. I could save it an hour but not 'every' hour because of the error with the filename. Is there a way to just have a file which is updating every hour until it reaches a whole day and automatically save it with the same file name? Thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try ...

In ThisWorbook Module
Code:
Sub Workbook_Open()
    Call SaveMe
End Sub

In STANDARD module
Code:
Sub SaveMe()
    Const fPath = "C:\Folder\SubFolder[COLOR=#ff0000]\[/COLOR]"         'end path with  [COLOR=#ff0000]\[/COLOR]
[I][COLOR=#006400]'unique name[/COLOR][/I]
    Dim fName As String
    fName = Format(Date, "YYMMDD_") & Round(Timer, 0) & "_" & ThisWorkbook.Name

    ActiveWorkbook.SaveCopyAs fPath & fName

[COLOR=#006400][I]'call again in one hour[/I][/COLOR]
    Application.OnTime Now + TimeValue("01:00:00"), "SaveMe"
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,988
Members
452,541
Latest member
haasro02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top