Quote Originally Posted by georgiboy View Post
I think that may well be the issue, I have had issues like this in the past but all Excel side. Back then I used the same method to refresh the query before I then refreshed the pivot tables to create an all in one refresh scenario. Below is the code I used in case it is any help:

Sub RefreshQuery()
    Application.ScreenUpdating = False    With Sheet1.ListObjects("tbProjData")
        .AutoFilter.ShowAllData
        .QueryTable.Refresh BackgroundQuery:=False
        .Sort.SortFields.Clear
        .Range.AutoFilter 3, "<>"
    End With
    Sheet3.ListObjects("tbLastSaved").QueryTable.Refresh BackgroundQuery:=False
    Sheet3.ListObjects("tbStandby").QueryTable.Refresh BackgroundQuery:=False
    Sheet3.PivotTables("PivotTable1").PivotCache.Refresh
    Sheet3.PivotTables("PivotTable2").PivotCache.Refresh
    Sheet3.PivotTables("PivotTable3").PivotCache.Refresh
    Sheet3.PivotTables("PivotTable4").PivotCache.Refresh
    Application.ScreenUpdating = True
End Sub
Instead of updating pivots i suppose you would run your copy code.
Yeah, I think it is. I stumbled across the solution because I found an old app of mine where I was querying a database and I had done as you are doing, setting the BackgroundQuery property to False. In my app though I can set that property of the query in the workbook via the GUI, so it is set at all times to False.