I have several spreadsheets that are on a SharePoint site that contain connections to a SharePoint list. Each sheet contains multiple connections. I need to automate the process to open each spreadsheet, perform a RefreshAll then save the spreadsheet. The VBA code works perfectly if I step through it using F8 but if I let it run it appears to go through the refresh (I see the messages showing the connections), it saves the file but the saved file does not contain the refreshed data. I added an Application.Wait in case the refresh was not complete but that did not help. I have searched for similar issues but did not find anything. Any help would be appreciated.

Sub RefreshWorksheets()
'
' RefreshWorksheets Macro
' Refresh all worksheets in the Summary Documents library
'
    Dim ActiveWks
    Dim PathName
    Dim FolderName
    Dim FileName
        
    
    ActiveWks = ActiveWorkbook.Name
    
    FolderName = "Folder1"
    RefreshSheet1 FolderName
    RefreshSheet2 FolderName
    
    FolderName = "Folder2"
    RefreshSheet1 FolderName
    RefreshSheet2 FolderName
    
    FolderName = "Folder3"
    RefreshSheet1 FolderName
    RefreshSheet2 FolderName
       
    Windows(ActiveWks).Activate
    Application.ActiveWindow.Close SaveChanges:=True
    Application.Quit

End Sub


Sub RefreshSheet1(FolderName)
    
    Dim WksPath
    Dim FileName
    
    WksPath = "//xxx.com/sites/mysite/coll/SummaryDocuments/" & FolderName & " Summaries/" & FolderName & " Review and Success Ratings.xlsx"
    FileName = FolderName & " Review and Success Ratings.xlsx"
    On Error GoTo ErrorHandler1:
    Workbooks.Open FileName:=WksPath
    Workbooks(FileName).Activate
    ActiveWorkbook.RefreshAll
    Application.Wait (Now + TimeValue("00:01:30"))
    ActiveWorkbook.Close SaveChanges:=True
    
ErrorHandler1:
    Exit Sub

End Sub


Sub RefreshSheet2(FolderName)
    
    Dim WksPath
    Dim FileName
      
    WksPath = "//xxx.com/sites/mysite/coll/SummaryDocuments/" & FolderName & " Summaries/" & FolderName & " Executive Summary.xlsx"
    FileName = FolderName & " Executive Summary.xlsx"
    On Error GoTo ErrorHandler2:
    Workbooks.Open FileName:=WksPath
    Workbooks(FileName).Activate
    ActiveWorkbook.RefreshAll
    Application.Wait (Now + TimeValue("00:01:30"))
    ActiveWorkbook.Close SaveChanges:=True
    
ErrorHandler2:
    Exit Sub

End Sub