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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,216,099
Messages
6,128,813
Members
449,469
Latest member
Kingwi11y

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