title: Refresh Excel connections
body: <p>I'm trying to loop through each connection in my Excel workbook and refresh each one individually and capture any error messages in between each refresh. However, I receive a 'Type-Mismatch' error when trying to run the code:</p>
  
  <pre><code>Private Sub btnRefreshConns_Click()
  Dim cn As WorkbookConnection
  Set cn = ActiveWorkbook.Connections.Count
  
  For Each cn In Workbook.Connections
  
  cn.Refresh
  
  Next
  
  End Sub
  </code></pre>
  
  <p>Could someone please assist me?</p>