I am using the code at the end of this post to make the sheet autosave every x minutes. The autosave function works perfectly.
The issue is if there is another excel file open at the time of close the autosave sheet reopens at the time it would have saved.
There is another excel file that is always open as it is a required log.
Any ideas would be great. Thanks.
In Workbook
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:05:00"), "SaveThis"
End Sub
In a module
Sub SaveThis()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.OnTime Now + TimeValue("00:05:00"), "SaveThis"
End Sub
The issue is if there is another excel file open at the time of close the autosave sheet reopens at the time it would have saved.
There is another excel file that is always open as it is a required log.
Any ideas would be great. Thanks.
In Workbook
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:05:00"), "SaveThis"
End Sub
In a module
Sub SaveThis()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.OnTime Now + TimeValue("00:05:00"), "SaveThis"
End Sub