<?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: Table to Excel within Python script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133690#M10409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A href="http://resources.arcgis.com/en/help/main/10.2/0012/001200000054000000.htm"&gt;TableToExcel&lt;/A&gt; tool requires an input of a &lt;A href="http://resources.arcgis.com/en/help/main/10.1/0017/00170000006v000000.htm"&gt;table view&lt;/A&gt;, not just the path to a table. Try making the table view first, then use that as input for the table to Excel process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jun 2015 21:22:53 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2015-06-16T21:22:53Z</dc:date>
    <item>
      <title>Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133689#M10408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to export my feature class to a table, and then also create a copy as an Excel document.&amp;nbsp; The following code keeps kicking back with an error saying that I am using the wrong file type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error message:&lt;/P&gt;&lt;P&gt;"Failed to execute. Parameters are not valid.&lt;/P&gt;&lt;P&gt;ERROR 000814: Invalid file type&lt;/P&gt;&lt;P&gt;Failed to execute (TableToExcel)."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;##########
# Create a file geodatabase for attribute tables to be saved in
##########


# Set local variables - uses variables derived earlier in script
attFolder = mapFolder + "/" + "6)Deliverables/4)Feature_Class_Attribute_Tables/" + version
outATTgdb = 'attribute_tables.gdb'

# Execute CreateFileGDB
arcpy.CreateFileGDB_management(attFolder, outATTgdb, 'CURRENT')


##########
# General Features export
##########

# Set local variables
inTable = generalFeatures
exportLoc = attFolder + "/" + outATTgdb
outTable = "general_attributes"
outXLS = "general_attributes.xls"

# Execute TableToTable
arcpy.TableToTable_conversion(inTable, exportLoc, outTable)

arcpy.env.workspace = 'attFolder'

# Execute TableToExcel
arcpy.TableToExcel_conversion(inTable, outXLS)









&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried modifying this a bit, with no positive results.&amp;nbsp; For the outXLS variable I tried to make it equal the entire save location, and then removed the arcpy.env.workspace variable, but everything that I have tried results in the same "invalid file type" error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any recommendations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133689#M10408</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2021-12-11T07:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133690#M10409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A href="http://resources.arcgis.com/en/help/main/10.2/0012/001200000054000000.htm"&gt;TableToExcel&lt;/A&gt; tool requires an input of a &lt;A href="http://resources.arcgis.com/en/help/main/10.1/0017/00170000006v000000.htm"&gt;table view&lt;/A&gt;, not just the path to a table. Try making the table view first, then use that as input for the table to Excel process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 21:22:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133690#M10409</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-06-16T21:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133691#M10410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What sort of table is your input for Table to Excel?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 21:25:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133691#M10410</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-06-16T21:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133692#M10411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;This points to a string 'attFolder':&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14344899428131036" data-renderedposition="26_8_912_16" jivemacro_uid="_14344899428131036"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;arcpy.env.workspace = &lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'attFolder'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: inherit; color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt;but you want the variable attfolder:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14344899337468587 jive_text_macro" data-renderedposition="78_8_912_16" jivemacro_uid="_14344899337468587"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN style="color: #000000; font-size: 12px;"&gt;arcpy.env.workspace = &lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;attFolder&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="background-color: inherit; color: black; font-weight: inherit; font-size: 9pt !important; font-style: inherit;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 21:26:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133692#M10411</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-06-16T21:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133693#M10412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just to make sure you aren't using 64 bit processing​&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002100000040000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//002100000040000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;not supported &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 21:35:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133693#M10412</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-06-16T21:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133694#M10413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good spot, Darren. On that note, the Python OS module can create file paths more reliably than concatenating strings. Try &lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;A href="http://pymotw.com/2/ospath/"&gt;os.path.join()&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2015 15:07:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133694#M10413</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-06-17T15:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133695#M10414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll have to play around with the table view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially I am porting over a very large model builder model.&amp;nbsp; Following the workflow in order as it is in Model Builder, I just used the same table name thinking it would work.&amp;nbsp; I'll try this with the table view option when I get a little more time to tinker with it and I'll respond with my results. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 19:27:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133695#M10414</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2015-06-18T19:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133696#M10415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am taking a feature class and running the Table to Table tool to save it as a data table.&amp;nbsp; Then I am taking that data table and exporting it to Excel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 19:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133696#M10415</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2015-06-18T19:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133697#M10416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good catch, Darren.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blake, how would I construct this when I am using variables and added strings?&amp;nbsp; I didn't fully understand the examples in the provided link.&amp;nbsp; Also, why would concatenating strings be unreliable?&amp;nbsp; Just trying to understand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to both of you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 20:11:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133697#M10416</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2015-06-18T20:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133698#M10417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am indeed using 64 bit background processing.&amp;nbsp; Do you have any suggestions as to a workaround that doesn't result in me and everyone else that would use this tool having to install 32 bit libraries on top of the 64 bit libraries? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 20:15:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133698#M10417</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2015-06-18T20:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133699#M10418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Coy&lt;/P&gt;&lt;P&gt;from the link I provided&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Background Geoprocessing (64-bit)&lt;/SPAN&gt; is available as a separate installation on top of&amp;nbsp; &lt;SPAN&gt;ArcGIS for Desktop&lt;/SPAN&gt;. The following information only applies if you have the &lt;SPAN&gt;Background Geoprocessing (64-bit)&lt;/SPAN&gt; product installed; otherwise, background processing is done in 32 bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the recommended workaround&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following data types are unsupported in 64-bit processing:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A class="xref" href="http://resources.arcgis.com/en/help/main/10.2/003n/003n00000007000000.htm" rel="/en/help/main/10.2/003n/003n00000007000000.htm"&gt;Personal geodatabase&lt;/A&gt; (&lt;SPAN class="usertext"&gt;.mdb&lt;/SPAN&gt;)&lt;/LI&gt;&lt;LI&gt;Excel tables (&lt;SPAN class="usertext"&gt;.xls&lt;/SPAN&gt;, &lt;SPAN class="usertext"&gt;.xlsx&lt;/SPAN&gt;)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If your workflow involves any of the above data types, &lt;EM&gt;&lt;STRONG&gt;you can execute the tool in the foreground by disabling background processing or convert your data to a supported type, then execute the tool in the background&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 20:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133699#M10418</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-06-18T20:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133700#M10419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"Unreliable" may have been the wrong word. It tends to be harder to read, which could make it unreliable. It's easy to get messed up on the slashes and get one the wrong way, or accidentally add an extra one. Plus it's also less flexible than os.path. For example, instead of using string concatenation like this&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attFolder = mapFolder + "/" + "6)Deliverables/4)Feature_Class_Attribute_Tables/" + version
outATTgdb = 'attribute_tables.gdb'
exportLoc = attFolder + "/" + outATTgdb&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use os.path to define your pieces separately and put them all together in a more readable way without worrying about the slashes.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mapFolder = r"C:\temp"
version = "v99"
outATTgdb = "attribute_tables.gdb"

attFolder = os.path.join(mapFolder, "6)Deliverables", "4)Feature_Class_Attribute_Tables", version)
exportLoc = os.path.join(attFolder, outATTgdb)&lt;/PRE&gt;&lt;P&gt;Notice the r in front of the string for mapFolder. That specifies the string as "raw" so a single backslash doesn't need a second escape backslash. I find it easier this way so you can just copy/paste directory paths.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133700#M10419</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-11T07:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133701#M10420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have background geoprocessing turned off, so I'm wondering if this isn't the issue.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 15:44:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133701#M10420</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2015-06-19T15:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133702#M10421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, that makes more sense now.&amp;nbsp; Thanks for the clarification.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 16:43:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133702#M10421</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2015-06-19T16:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133703#M10422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just tried it without a Table View and it worked. Here's my code.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os

myDir = r"C:\Temp"
myGDB = "TEMP.gdb"
myTable = os.path.join(myDir, myGDB, "SomeTableName")
myExcel = os.path.join(myDir, "myExcel.xls")

arcpy.TableToExcel_conversion(myTable, myExcel)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:29:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133703#M10422</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-11T07:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133704#M10423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I moved past this portion of the script and on to a different part that pulls the feature classes exactly how they are in the map and does the exact same thing (TableToTable and then TableToExcel).&amp;nbsp; That part works just fine, so I'm thinking that there's no compatibility issues going on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Export TableToTable &amp;amp; TableToExcel

# Set Local Variables
exportTable = updatedTable # This table is the result of the summary statistics tool in the previous step
exportLoc = kmfFolder + "/" + outKMFgdb
outTable = "general_KMF"
outXLS = "general_KMF.xls"

# Execute TableToTable
arcpy.TableToTable_conversion(exportTable, exportLoc, outTable, "", "", "") # this part works fine

# Set Local Variables
inTable = outTable # hoping to grab the result of the TableToTable function above

# Execute TableToExcel
arcpy.TableToExcel_conversion(inTable, outXLS)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this instance, the TableToExcel keeps kicking back saying that the file type is invalid just as it did before, though.&amp;nbsp; I've tried various ways of setting the inTable variable in line 13, but none of them have worked.&amp;nbsp; I also tried to create a table view between the two tool functions and it still said invalid file type.&amp;nbsp; I can't hard code the variable name because the location will be variable depending on the name of the map.&amp;nbsp; Essentially the kmfFolder variable grabs the maps file location and adds a few characters that are standard between maps, and that is where everything is saved for the current map document. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples of what I've tried using for the inTable variable:&lt;/P&gt;&lt;P&gt;inTable = outKMFgdb + "/" + outTable&lt;/P&gt;&lt;P&gt;inTable = exportLoc + "/" + outTable&lt;/P&gt;&lt;P&gt;inTable = (combo of all above) + "/general_KMF"&lt;/P&gt;&lt;P&gt;inTable = (combo of all above) + "/general_KMF.dbf"&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*NOTE*:&amp;nbsp; I intend on implementing the os.path.join suggestion mentioned above, but I'm just trying to get it working for now.&amp;nbsp; Since the method I am using works in other areas of the script, especially in areas that due essentially the same thing, I don't think it's what's causing this particular issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:29:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133704#M10423</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2021-12-11T07:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133705#M10424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should split this off into a new thread.&amp;nbsp; From the original thread, no apparent resolution seems to be found.&amp;nbsp; You should close it by turning it into a discussion or marking it assumed read or mark one of the threads as providing the answer.&amp;nbsp; At 15+ posts long, it is way too long to follow and new requests provide a confusing fork in the road&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 20:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133705#M10424</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-06-29T20:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133706#M10425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was looking at this the wrong way.&amp;nbsp; I was assuming that the error was referring to the input table that was incorrect, but it was actually referring to the output file as being incorrect.&amp;nbsp; Instead of simply giving the output a name, I gave it a save location with a name, and it worked just fine.&amp;nbsp; See the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Set local variables
inTable = outTable
outXLS = kmfFolder + "/general_KMF.xls" #this is where I had to give the file path and then the file name

# Execute TableToExcel
arcpy.TableToExcel_conversion(inTable, outXLS)
ersion(inTable, outXLS)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133706#M10425</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2021-12-11T07:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133707#M10426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Duly noted for future reference.&amp;nbsp; I ended up resolving the issue, though.&amp;nbsp; Please see the code pasted below.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help in this thread and all others.&amp;nbsp; I've seen your name quite a bit in some of my threads, so thank you for all of your time. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 20:32:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133707#M10426</guid>
      <dc:creator>CoyPotts1</dc:creator>
      <dc:date>2015-06-29T20:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Table to Excel within Python script</title>
      <link>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133708#M10427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Coy&lt;/P&gt;&lt;P&gt;Did you resolve all the issues discussed above? If so, would you be willing to share the script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm running into several similar challenges. &amp;nbsp;I would like to do the following: convert all the shapefiles in a gdb into spreadsheets and store the spreadsheets in their own folder or gdb. Eventually, I would like to convert this to a script tool that includes parameters for which gdb to search for shapefiles and where to store the final spreadsheets. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, and I am new to Python, too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2017 17:23:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-excel-within-python-script/m-p/133708#M10427</guid>
      <dc:creator>DougHaller1</dc:creator>
      <dc:date>2017-06-13T17:23:15Z</dc:date>
    </item>
  </channel>
</rss>

