Solved! See below for solution!
I\'m in Excel 2010 connecting to multiple, seperate Access 2010 db\'s from Excel through PivotTable dat
This is not a full answer, but an attempt to help debug, so that hopefully we can arrive at a solution.
I believe you can solve this issue by debugging the Connections. Try replacing your Refresh code above (and the replacement with DoEvents) with the following Sub. First, it is possible that displaying the dialog between Refreshes will fix the problem (if the problem is concurrent refreshes, etc). Second, each time it runs, check carefully that nothing has changed. Please report back with any discoveries or info. If you still get the errors, step through the code and report back the line that raises the error.
Sub ShowDebugDialog()
Dim x As Integer
Dim i As Integer, j As Integer
Dim awc As WorkbookConnection
Dim c As OLEDBConnection
For i = 1 To ActiveWorkbook.Connections.Count
'For i = ActiveWorkbook.Connections.Count To 1 Step -1
For j = 1 To ActiveWorkbook.Connections.Count
Set awc = ActiveWorkbook.Connections.Item(j)
Set c = awc.OLEDBConnection
x = MsgBox("ConnectionName: " & awc.Name & vbCrLf & _
"IsConnected: " & c.IsConnected & vbCrLf & _
"BackgroundQuery: " & c.BackgroundQuery & vbCrLf & _
"MaintainConnection: " & c.MaintainConnection & vbCrLf & _
"RobustConnect: " & c.RobustConnect & vbCrLf & _
"RefreshPeriod: " & c.RefreshPeriod & vbCrLf & _
"Refreshing: " & c.Refreshing & vbCrLf & _
"EnableRefresh: " & c.EnableRefresh & vbCrLf & _
"Application: " & c.Application & vbCrLf & _
"UseLocalConnection: " & c.UseLocalConnection _
, vbOKOnly, "Debugging")
Next j
Set awc = ActiveWorkbook.Connections.Item(i)
Set c = awc.OLEDBConnection
c.EnableRefresh = True
c.BackgroundQuery = False
c.Reconnect
c.Refresh
awc.Refresh
c.MaintainConnection = False
Next i
End Sub
Additional questions you can answer if you're still getting errors:
Sorry for all the questions but you have to think of everything when debugging nasty connection errors like this.