E
E
Egor2017-10-10 15:52:31
excel
Egor, 2017-10-10 15:52:31

Autosave Excel file to original location with overwriting?

Hello, it is necessary that Excel, at a given time interval, save changes to the file from which it was opened, and not to the appdata. What solutions exist?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lvv85, 2017-10-10
@y0hm

In the personal book of macros ("Personal.xlsb") add an event to open the book ("ThisBook" module)

Private Sub Workbook_Open()
    AutoSaveAllWorkbooks
End Sub

AutoSaveAllWorkbooks - Procedure for saving all open workbooks (restarting the procedure every 30 seconds)
Add a module and paste the following code:
Public Sub AutoSaveAllWorkbooks()
    Dim wb As Workbook
    
    For Each wb In Application.Workbooks
        wb.Save
        
        Set wb = Nothing
    Next
    
    Application.OnTime Now + TimeValue("00:00:30"), "AutoSaveAllWorkbooks"
    
End Sub

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question