title: Export Power Queries from One Workbook to Another with VBA
body: <p>I am looking to transfer power queries from one workbook to another with VBA. I know how to do this manually but it is very cumbersome.</p>
  
  <p>A power query can be accessed via the Workbook.Connections object. 
  I am currently attempting to port the queries over with a VBA function or Sub.</p>
  
  <p>The manual process is as follows</p>
  
  <ul>
  <li>for each query in workbook 1</li>
  <li>open up workbook 1 and go to advanced editor - copy into a text editor</li>
  <li>open up workbook 2 create query, and paste text into advanced editor</li>
  <li>ensure source tables are the same - and run query to validate</li>
  </ul>