title: Create Copy of Excel Workbook and Remove Query Connections
body: <p>Evening Everyone, </p>
  
  <p>I have a workbook that has power query connections and I'm looking to create and save a copy of that file and remove the query connections in the new file and keep the connections in the first file.</p>
  
  <p>This is the code so far which I've combined from the web:</p>
  
  <pre><code>Clone Copy()
  Dim cn As WorkbookConnection
  Dim qr As WorkbookQuery
  Dim NewFilePath As String
  
      NewFilePath = ThisWorkbook.Path &amp; "\Cloned_Workbook.xlsm"
  
      If VBA.Dir(NewFilePath) &lt;&gt; "" Then
          MsgBox "File With Same Name Exists already. Enter Different Name"
          End
      End If
  
      With ActiveWorkbook
          .SaveCopyAs Filename:=NewFilePath
          On Error Resume Next
          For Each cn In ThisWorkbook.Connections
      cn.Delete
  Next
  For Each qr In ThisWorkbook.Queries
      qr.Delete
      Next
  End Sub
  </code></pre>
  
  <p>This removes the query connections from the existing file and keeps the connections in the copied file which is the opposite of what I'm looking for.</p>
  
  <p>Any help is much appreciated :)</p>
  
  <p>Shrew</p>