<?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: arcpy.conversion.TableToExcel with list in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300721#M70355</link>
    <description>&lt;P&gt;I looked more closely at &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/conversion/table-to-excel.htm" target="_self"&gt;the&amp;nbsp;TableToExcel documentation&lt;/A&gt;, and I do see that the table of parameters shows it should accept a list. (It's pretty subtle, the summary says "a table," i.e. singular, but below it shows the parameter accepted as either "Input_Table" or "[Input_Table,...]".)&lt;/P&gt;&lt;P&gt;If the only difference between your code is .xls vs .xlsx, it should work. I tried it out on a few layers I currently have open, and it worked either way from a Python window in ArcGIS Pro 3.1.2. Perhaps the &lt;EM&gt;name&lt;/EM&gt; you are searching for is not returning the list you're expecting? Maybe print out the list before calling&amp;nbsp;TableToExcel.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2023 14:03:18 GMT</pubDate>
    <dc:creator>BuffaloCoWI</dc:creator>
    <dc:date>2023-06-19T14:03:18Z</dc:date>
    <item>
      <title>arcpy.conversion.TableToExcel with list</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300159#M70281</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have a dataset with a lot of model outputs that ran through an iterator. So it looks a little like this:&lt;/P&gt;&lt;P&gt;A1_abc&lt;/P&gt;&lt;P&gt;A1_xyz&lt;/P&gt;&lt;P&gt;A2_abc&lt;/P&gt;&lt;P&gt;A2_xyz&lt;/P&gt;&lt;P&gt;A3_abc&lt;/P&gt;&lt;P&gt;A3_xyz&lt;/P&gt;&lt;P&gt;And so forth, just a bit more complex.&lt;/P&gt;&lt;P&gt;Now I want to export the tables with the same "suffix" to one Excel table and I wrote the following into the Python window:&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = "(Workspace)"&lt;BR /&gt;list = []&lt;BR /&gt;name = "abc"&lt;BR /&gt;for fc in arcpy.ListFeatureClasses(f"*{name}"):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; list.append(fc)&lt;BR /&gt;list.sort()&lt;BR /&gt;arcpy.conversion.TableToExcel(list,f"(Output location)\\Location_{name}")&lt;/P&gt;&lt;P&gt;I substituted the workspace path the output location path with (Workspace) and (Output location).&lt;/P&gt;&lt;P&gt;This works fine, though it returns an .xls file. Now if I try to add an .xlsx at the end to the code so it looks like this:&lt;/P&gt;&lt;P&gt;aarcpy.env.workspace = "(Workspace)"&lt;BR /&gt;list = []&lt;BR /&gt;name = "SensEin_o_Ue_VK_1500"&lt;BR /&gt;for fc in arcpy.ListFeatureClasses(f"*{name}"):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; list.append(fc)&lt;BR /&gt;list.sort()&lt;BR /&gt;arcpy.conversion.TableToExcel(list,f"(Output location)\\Location_{name}.xlsx")&lt;/P&gt;&lt;P&gt;It returns an error message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 367, in &amp;lt;module&amp;gt;&lt;BR /&gt;table_to_excel(arcpy.GetParameterAsText(0),&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 247, in table_to_excel&lt;BR /&gt;rowUpdated = list(row)&lt;BR /&gt;TypeError: 'list' object is not callable&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 6, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\conversion.py", line 559, in TableToExcel&lt;BR /&gt;raise e&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\conversion.py", line 556, in TableToExcel&lt;BR /&gt;retval = convertArcObjectToPythonObject(gp.TableToExcel_conversion(*gp_fixargs((Input_Table, Output_Excel_File, Use_field_alias_as_column_header, Use_domain_and_subtype_description), True)))&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: Traceback (most recent call last):&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 367, in &amp;lt;module&amp;gt;&lt;BR /&gt;table_to_excel(arcpy.GetParameterAsText(0),&lt;BR /&gt;File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 247, in table_to_excel&lt;BR /&gt;rowUpdated = list(row)&lt;BR /&gt;TypeError: 'list' object is not callable&lt;/P&gt;&lt;P&gt;Failed to execute (TableToExcel).&lt;/P&gt;&lt;P&gt;Anyone any ideas why this does not like the .xlsx?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 07:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300159#M70281</guid>
      <dc:creator>IlkaIllers1</dc:creator>
      <dc:date>2023-06-22T07:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.conversion.TableToExcel with list</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300277#M70291</link>
      <description>&lt;P&gt;You'll have to call the&amp;nbsp;&lt;SPAN&gt;TableToExcel function in a loop for each value in the list, not just pass a list to the function. It only expects a single value each for the input and output tables.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 16:09:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300277#M70291</guid>
      <dc:creator>BuffaloCoWI</dc:creator>
      <dc:date>2023-06-16T16:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.conversion.TableToExcel with list</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300458#M70318</link>
      <description>&lt;P&gt;But wouldn't that create separate Excel tables? And why does it work for .xls then?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 00:06:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300458#M70318</guid>
      <dc:creator>IlkaIllers1</dc:creator>
      <dc:date>2023-06-17T00:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.conversion.TableToExcel with list</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300721#M70355</link>
      <description>&lt;P&gt;I looked more closely at &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/conversion/table-to-excel.htm" target="_self"&gt;the&amp;nbsp;TableToExcel documentation&lt;/A&gt;, and I do see that the table of parameters shows it should accept a list. (It's pretty subtle, the summary says "a table," i.e. singular, but below it shows the parameter accepted as either "Input_Table" or "[Input_Table,...]".)&lt;/P&gt;&lt;P&gt;If the only difference between your code is .xls vs .xlsx, it should work. I tried it out on a few layers I currently have open, and it worked either way from a Python window in ArcGIS Pro 3.1.2. Perhaps the &lt;EM&gt;name&lt;/EM&gt; you are searching for is not returning the list you're expecting? Maybe print out the list before calling&amp;nbsp;TableToExcel.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 14:03:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-conversion-tabletoexcel-with-list/m-p/1300721#M70355</guid>
      <dc:creator>BuffaloCoWI</dc:creator>
      <dc:date>2023-06-19T14:03:18Z</dc:date>
    </item>
  </channel>
</rss>

