I'm trying to execute the code below but I'm getting an error that says the operation cannot be done because the data is refreshing in the background. How do I get it to wait until the queries have refreshed? I already have "enable background refresh" selected for all the data connections.
For Each wks In ActiveWorkbook.Worksheets
For Each ObjList In wks.ListObjects