<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ArcGIS Pro (2.9.x) Notebook save .xlsm Macro to .xlsx in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-9-x-notebook-save-xlsm-macro-to-xlsx/m-p/1234347#M66158</link>
    <description>&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/39292179/how-to-convert-xlsm-macro-enabled-excel-file-to-xlsx-using-python" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/39292179/how-to-convert-xlsm-macro-enabled-excel-file-to-xlsx-using-python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am attempting to use the code in the above Stack post to save a .xlsm to a .xlsx using win32com in Notebook and it is not working.&lt;/P&gt;&lt;P&gt;There are many other suggestions for converting a .xlsm to .xlsx and each one of them relies on using some version of "Save" (SaveCopy, SaveAs, etc.) and none of them are working for me.&lt;/P&gt;&lt;P&gt;The error I keep getting is: xlsxwriter object has no attribute 'fill in the blank'&lt;/P&gt;&lt;P&gt;Keep in mind that I am fairly new at this (thank you)&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;#Export xlsm to xlsm)&lt;/P&gt;&lt;P&gt;import win32com.client&lt;/P&gt;&lt;P&gt;excel = win32.gencache.EnsureDispatch('Excel.Application')&lt;BR /&gt;excel.Application.Quit()&lt;/P&gt;&lt;P&gt;# Load the .XLSM file into Excel&lt;/P&gt;&lt;P&gt;wb = excel.Workbooks.Open(r'S:\ALL\GIS\Software\NIGHTLY_UPDATES\GIS_CAMA_RECONCILIATION\RECONCILIATION_STAGING\GIS_CAMA_Reconciliation1.xlsm')&lt;/P&gt;&lt;P&gt;# Save it in .XLSX format to a different filename&lt;/P&gt;&lt;P&gt;excel.DisplayAlerts = False&lt;BR /&gt;writer.DoNotPromptForConvert = True&lt;BR /&gt;writer.CheckCompatibility = False&lt;BR /&gt;writer.SaveAs(r'S:\ALL\GIS\Software\NIGHTLY_UPDATES\GIS_CAMA_RECONCILIATION\RECONCILIATION_STAGING\GIS_CAMA_Reconciliation1.xlsx', FileFormat=51, ConflictResolution=2)&lt;BR /&gt;excel.Application.Quit()&lt;BR /&gt;del excel&lt;BR /&gt;print(".XLSM Saved as .XLSX")&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;AttributeError&lt;/SPAN&gt;: 'XlsxWriter' object has no attribute 'SaveAs'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2022 22:33:55 GMT</pubDate>
    <dc:creator>ElisseDeleissegues1</dc:creator>
    <dc:date>2022-11-22T22:33:55Z</dc:date>
    <item>
      <title>ArcGIS Pro (2.9.x) Notebook save .xlsm Macro to .xlsx</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-9-x-notebook-save-xlsm-macro-to-xlsx/m-p/1234347#M66158</link>
      <description>&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/39292179/how-to-convert-xlsm-macro-enabled-excel-file-to-xlsx-using-python" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/39292179/how-to-convert-xlsm-macro-enabled-excel-file-to-xlsx-using-python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am attempting to use the code in the above Stack post to save a .xlsm to a .xlsx using win32com in Notebook and it is not working.&lt;/P&gt;&lt;P&gt;There are many other suggestions for converting a .xlsm to .xlsx and each one of them relies on using some version of "Save" (SaveCopy, SaveAs, etc.) and none of them are working for me.&lt;/P&gt;&lt;P&gt;The error I keep getting is: xlsxwriter object has no attribute 'fill in the blank'&lt;/P&gt;&lt;P&gt;Keep in mind that I am fairly new at this (thank you)&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;#Export xlsm to xlsm)&lt;/P&gt;&lt;P&gt;import win32com.client&lt;/P&gt;&lt;P&gt;excel = win32.gencache.EnsureDispatch('Excel.Application')&lt;BR /&gt;excel.Application.Quit()&lt;/P&gt;&lt;P&gt;# Load the .XLSM file into Excel&lt;/P&gt;&lt;P&gt;wb = excel.Workbooks.Open(r'S:\ALL\GIS\Software\NIGHTLY_UPDATES\GIS_CAMA_RECONCILIATION\RECONCILIATION_STAGING\GIS_CAMA_Reconciliation1.xlsm')&lt;/P&gt;&lt;P&gt;# Save it in .XLSX format to a different filename&lt;/P&gt;&lt;P&gt;excel.DisplayAlerts = False&lt;BR /&gt;writer.DoNotPromptForConvert = True&lt;BR /&gt;writer.CheckCompatibility = False&lt;BR /&gt;writer.SaveAs(r'S:\ALL\GIS\Software\NIGHTLY_UPDATES\GIS_CAMA_RECONCILIATION\RECONCILIATION_STAGING\GIS_CAMA_Reconciliation1.xlsx', FileFormat=51, ConflictResolution=2)&lt;BR /&gt;excel.Application.Quit()&lt;BR /&gt;del excel&lt;BR /&gt;print(".XLSM Saved as .XLSX")&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;AttributeError&lt;/SPAN&gt;: 'XlsxWriter' object has no attribute 'SaveAs'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 22:33:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-9-x-notebook-save-xlsm-macro-to-xlsx/m-p/1234347#M66158</guid>
      <dc:creator>ElisseDeleissegues1</dc:creator>
      <dc:date>2022-11-22T22:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro (2.9.x) Notebook save .xlsm Macro to .xlsx</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-pro-2-9-x-notebook-save-xlsm-macro-to-xlsx/m-p/1234515#M66161</link>
      <description>&lt;P&gt;It would help if you formatted your code.&amp;nbsp; Click the ... then &amp;lt;/&amp;gt; to paste and select the code flavor.&lt;/P&gt;&lt;P&gt;I don't see where writer is created.&amp;nbsp; XlsxWriter and win32com has some quirks.&lt;/P&gt;&lt;P&gt;Have you tried wb.saveAs(..)?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 15:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-pro-2-9-x-notebook-save-xlsm-macro-to-xlsx/m-p/1234515#M66161</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-11-23T15:10:17Z</dc:date>
    </item>
  </channel>
</rss>

