title: How to extract data from a database and populate a sheet in Excel
body: <p>I am storing data in a backend database (PostgreSQL) which is running on a Linux machine. I want to be able to fetch data from the database, and populate a sheet in an excel workbook, so that I can carry out analysis in Excel.</p>
  
  <p>It has been quite a while since I wrote anything in VBA, so I would appreciate some help (or links) in getting started. I would like to know the best way to approach this:</p>
  
  <ol>
  <li>Pure VBA solution OR</li>
  <li>Mixture of C# or other .Net language for data extraction logic and VBA for manipulating Excel objects (sheet data population etc)</li>
  </ol>
  
  <p>Any ideas, tips, snippets and/or links that can help me get started on the twin objectives:</p>
  
  <ul>
  <li>fetching data from a backend database (PostgreSQL) into Excel</li>
  <li>populating a specified sheet in Excel with the columnar data retreived from the database</li>
  </ul>
  
  <p>will be much appreciated.</p>