There is a function that opens in turn all the files in a given folder, updates the data, saves and closes. The file is really opened and saved, but the data does not seem to have time to update, because file closes. How the solution seems to check whether the data update has ended. But how to implement it? Perhaps there is another solution.
Sub Obnovlenie_Sokhranenie_failov_v_papke() Dim s As String, fldr As String, j As Integer, f As Integer Dim rc As Range fldr = "d:\" s = Dir(fldr & "*.xls*") j = 0 f = 0 Application.ScreenUpdating = False 'podschyot kolichestva failov v papke Do While s <> "" s = Dir f = f + 1 Loop 'obrabotka failov v papke s = Dir(fldr & "*.xls*") Do While s <> "" With Workbooks.Open(fldr & s) 'deistviia s knigoi .RefreshAll .Save .Close (True) End With s = Dir j = j + 1 Application.StatusBar = "Obrabotano: " & j & " iz " & f & " failov" & " -> " & s: DoEvents Loop Application.ScreenUpdating = True ActiveWorkbook.RefreshAll Application.StatusBar = "Obrabotano: " & j & " èç " & f & " failov" End Sub