title: How to save XLSM file with Macro, using openpyxl
body: <p>I have <strong>.xlsm</strong> file with a <strong>Macro</strong> function. I'm loading it using <strong>openpyxl</strong> and write some data to the file and finally want to save as a different <strong>.xlsm</strong> file.</p>
  
  <p>To save the file as XLSM file I have used below code in my Python script.</p>
  
  <pre><code>wb.save('testsave.xlsm');
  </code></pre>
  
  <p>But I cannot open that file if I saved as above. But if I saved it as <strong>.xlsx</strong> then I can open the file without the Macro function that original file had.</p>
  
  <p>I want to open a Excel sheet that has Macro function, edit the file and save it as new <strong>.xlsm</strong> file using <strong>openpyxl</strong>. How can I do that?</p>