title: Excel: macro to export worksheet as CSV file without leaving my current Excel sheet
body: <p>There are a lot of questions here to create a macro to save a worksheet as a CSV file. All the answers use the SaveAs, like <a href="https://superuser.com/questions/381861/export-to-csv-from-excel">this one</a> from SuperUser. They basically say to create a VBA function like this:</p>
  
  <pre><code>Sub SaveAsCSV()
      ActiveWorkbook.SaveAs FileFormat:=clCSV, CreateBackup:=False
  End Sub
  </code></pre>
  
  <p>This is a great answer, but I want to do an <strong>export instead of Save As</strong>. When the SaveAs is executed it causes me two annoyances:</p>
  
  <ul>
  <li>My current working file becomes a CSV file. I'd like to continue working in my original .xlsm file, but to export the contents of the current worksheet to a CSV file with the same name.</li>
  <li>A dialog appears asking me confirm that I'd like to rewrite the CSV file.</li>
  </ul>
  
  <p>Is it possible to just export the current worksheet as a file, but to continue working in my original file?  </p>