title: How can I automate an Excel file refresh and send via email?
body: <p>I have a few Excel files (Pivot Tables &amp; Charts) that have a data connection to an Access database. What I'm hoping to do is have them automatically refresh and get emailed on the 1st of each month. </p>
  
  <p>I do something similar in Access, where I have a database with a query that gets run and emailed. I accomplished this by creating a form in the database, having the form open automatically when the database is opened, and then used VBA within the form to run the query (DoCmd.OpenQuery) and then email it (DoCmd.SendObject)</p>
  
  <p>Can I do something similar with an Excel file? I'm thinking I could set the Connection Properties under the Data tab to "Refresh data when opening the file", but that assumes the user has an active network connection as the database is on a server. Also, if the user saves the file and opens it again in the future, it will have current data and not the original data.</p>
  
  <p>So in a nutshell I need to:</p>
  
  <ol>
  <li>Open Excel File</li>
  <li>Refresh Data</li>
  <li>Email File</li>
  </ol>