title: Open XML SDK - Save a template file (.xltx to .xlsx)
body: <p>I have the following code to open Excel template file and save it as .xlsx file and I get the error below when I try to open the new file. Please help to resolve this.</p>
  
  <p><em>Excel cannot open the file ‘sa123.xlsx’ because the file format or the extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.</em></p>
  
  <pre><code>        string templateName = "C:\\temp\\sa123.xltx";
          byte[] docAsArray = File.ReadAllBytes(templateName);
          using (MemoryStream stream = new MemoryStream())
          {
              stream.Write(docAsArray, 0, docAsArray.Length);    // THIS performs doc copy
              File.WriteAllBytes("C:\\temp\\sa123.xlsx", stream.ToArray());    
          }
  </code></pre>