title: How to save a .xltm file to .xlsm with OpenXML?
body: <p>Ive been using the OpenXmlPackage.SaveAs to save my template files in to excel (.xltx to .xlsx) But when it comes to a macro enabled .xltm the file gets corrupt when saving to .xlsm</p>
  
  <p>I have been reading in the help sections for this API and various threads online but i couldnt find anything covering this so i could get it working.</p>
  
  <pre class="lang-cs prettyprint-override"><code>//open the excel using openxml sdk  
  using (SpreadsheetDocument doc = SpreadsheetDocument.CreateFromTemplate(fileOpen))
  {
      doc.SaveAs(fileClose);
  }
  </code></pre>
  
  <p>"Excel cannot open the file 'filename.xlsx' because the file format for the file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."</p>
  
  <p>Anyone out there that have a idea regarding this? Thanks in advance.</p>