<?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 Re: openpyxl error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1199589#M65215</link>
    <description>&lt;P&gt;I had a similar problem working with pandas creating an excel file based on an attribute table. It created the excel file but just running and running. Seeing that you had a such a similar issue makes me want to try without saving.&lt;/P&gt;&lt;P&gt;I solved the issue by uninstalling 3.0 and reinstalling 2.9&lt;/P&gt;</description>
    <pubDate>Thu, 04 Aug 2022 19:54:17 GMT</pubDate>
    <dc:creator>dabrooks</dc:creator>
    <dc:date>2022-08-04T19:54:17Z</dc:date>
    <item>
      <title>openpyxl error</title>
      <link>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1199543#M65213</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;ArcGIS Pro version: 3.0.0&lt;/P&gt;&lt;P&gt;openpyxl version: 3.0.9&lt;/P&gt;&lt;P&gt;I am trying to create an excel and edit it.&lt;/P&gt;&lt;P&gt;import openpyxl&lt;BR /&gt;layer = r"F:\Learning\Area.shp"&lt;BR /&gt;desc = arcpy.Describe(layer)&lt;BR /&gt;path = desc.path&lt;BR /&gt;target = path + '/' + 'CA.xlsx'&lt;BR /&gt;wb = openpyxl.Workbook(target)&lt;BR /&gt;wb.save(target)&lt;BR /&gt;ws = wb.active&lt;BR /&gt;ws.title = 'MySheet'&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It is working fine till this line of code. Then when I try to save it again, it throws an error.&lt;/P&gt;&lt;P&gt;wb.save(target)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Traceback (most recent call last):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\openpyxl\workbook\workbook.py", line 407, in save&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;save_workbook(self, filename)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\openpyxl\writer\excel.py", line 293, in save_workbook&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;writer.save()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\openpyxl\writer\excel.py", line 275, in save&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;self.write_data()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\openpyxl\writer\excel.py", line 75, in write_data&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;self._write_worksheets()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\openpyxl\writer\excel.py", line 215, in _write_worksheets&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;self.write_worksheet(ws)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\openpyxl\writer\excel.py", line 203, in write_worksheet&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;self._archive.write(writer.out, ws.path[1:])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\zipfile.py", line 1734, in write&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;zinfo = ZipInfo.from_file(filename, arcname,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\zipfile.py", line 501, in from_file&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;st = os.stat(filename)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\user\\AppData\\Local\\Temp\\ArcGISProTemp24588\\openpyxl.xhbljeyb'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Why am I getting this error when trying to save a second time??&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 11:40:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1199543#M65213</guid>
      <dc:creator>RajeshPatnaik</dc:creator>
      <dc:date>2022-08-06T11:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: openpyxl error</title>
      <link>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1199589#M65215</link>
      <description>&lt;P&gt;I had a similar problem working with pandas creating an excel file based on an attribute table. It created the excel file but just running and running. Seeing that you had a such a similar issue makes me want to try without saving.&lt;/P&gt;&lt;P&gt;I solved the issue by uninstalling 3.0 and reinstalling 2.9&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 19:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1199589#M65215</guid>
      <dc:creator>dabrooks</dc:creator>
      <dc:date>2022-08-04T19:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: openpyxl error</title>
      <link>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1200132#M65231</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/608070"&gt;@dabrooks&lt;/a&gt; for your reply&lt;/P&gt;&lt;P&gt;I tried by&amp;nbsp;&lt;SPAN&gt;uninstalling 3.0 and reinstalling 2.9. The issue was not solved.&lt;BR /&gt;&lt;BR /&gt;After lot of search, I&amp;nbsp;came to know that once we save our created workbook, we can not write again to it. So, I did as follows and it works.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;import openpyxl&lt;BR /&gt;layer = r"F:\Learning\Area.shp"&lt;BR /&gt;desc = arcpy.Describe(layer)&lt;BR /&gt;path = desc.path&lt;BR /&gt;target = path + '/' + 'CA.xlsx'&lt;BR /&gt;wb = openpyxl.Workbook()&lt;BR /&gt;ws = wb.active&lt;BR /&gt;ws.title = 'MySheet'&lt;BR /&gt;#write here whatever needed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#save at the end&lt;BR /&gt;wb.save(target)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 11:40:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1200132#M65231</guid>
      <dc:creator>RajeshPatnaik</dc:creator>
      <dc:date>2022-08-06T11:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: openpyxl error</title>
      <link>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1234000#M66154</link>
      <description>&lt;P&gt;The Python "ModuleNotFoundError: No module named 'openpyxl'" occurs when we forget to install the openpyxl module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install openpyxl command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This may help you,&lt;/P&gt;&lt;P&gt;Rachel Gomez&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 05:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/openpyxl-error/m-p/1234000#M66154</guid>
      <dc:creator>RachelGomez</dc:creator>
      <dc:date>2022-11-22T05:08:56Z</dc:date>
    </item>
  </channel>
</rss>

