title: how to save a sheet in VBA
body: <p>I'm building a form that when you fill it up, it should generate 2 files as output.</p>
  
  <p>In order to do that I have 2 sheets in the background that I fill up depending on what the user entered a button to save them (as csv).</p>
  
  <p>This is the code for saving the sheet-</p>
  
  <pre><code>Worksheets("worksheetname").SaveAs Filename:="C:\path" &amp; name &amp; ".csv", FileFormat:=xlCSV, CreateBackup:=False
  </code></pre>
  
  <p>The problem is that after the user presses the button, the form that he is filling is now 'saved as csv', and not xlsm like before.</p>
  
  <p>Is there a way to avoid that from happening? to generate the output without affecting the form?</p>
  
  <p>Thanks! </p>