"Waiting for another application to complete the OLE action" is not a warning message that you can simply turn off and forget, sometimes the macro can continue to work, but, in my experience, if you get this error, only a matter of time until the problem crashes / your entire macro freezes, so it should definitely be fixed and fixed.
I get this error only if I use additional Microsoft Office applications (other than Excel, which use code) as objects, and one of them has an error: Excel executing the code does not know that an error has occurred in one of other applications, so it waits and waits and waits, and in the end you will receive the message "Waiting for another application to complete the OLE action" ...
So, to fix this problem, you need to look for places where you use other MSO applications ... In your example, you have an extra instance of Excel and you are extracting data from Access, so its most likely one of the two that cause Problems...
Below I will talk about how I would rewrite this code, being more careful about where the code interacts with other MSO applications, clearly controlling what happens in them. The only thing I really could not do was GetPivotsToRefresh because I cannot understand what exactly you are doing here, but in my code I just assumed that it returned an array with a list of excel files that you want to update. See the following code:
Sub Refresh_BoardPivots_Standard() Dim pivotWB As Workbook Dim fileList() As Variant Dim fileCounter As Long Application.DisplayAlerts = False fileList = GetPivotsToRefresh 'populate array from SQL For fileCounter = 1 To UBound(fileList, 1) Set pivotWB = Workbooks.Open(fileList(fileCounter, 1), False, False) If pivotWB.ReadOnly = False Then Call refreshPivotTables(pivotWB) pivotWB.Close (True) Else '... Error handler ... pivotWB.Close (False) End If Next End Sub Public Sub refreshPivotTables(targetWB As Workbook) Dim wsCounter As Long Dim ptCounter As Long For wsCounter = 1 To targetWB.Sheets.Count With targetWB.Sheets(wsCounter) If .PivotTables.Count > 0 Then For ptCounter = 1 To .PivotTables.Count .PivotTables(ptCounter).RefreshDataSourceValues Next .Calculate End If End With Next End Sub
So, I created my own "refreshPivotTables", but you could embed them in the main sub, I just thought that the loops and loop counts might get a little confused at this point ...
Hope this helps, TheSilkCode