<?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: Script to import Excel files in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649784#M50575</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked fine on a dummy file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's odd is that the conversion works fine with the files as they are when done manually with the Excel to Table tool in ArcMap&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 May 2016 19:07:09 GMT</pubDate>
    <dc:creator>MarleneSanchez</dc:creator>
    <dc:date>2016-05-31T19:07:09Z</dc:date>
    <item>
      <title>Script to import Excel files</title>
      <link>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649781#M50572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a script to import a few properly formatted excel files into ArcMap with the Excel to Table conversion tool.&lt;/P&gt;&lt;P&gt;The script is throwing an exception saying "Filed in invalid".&lt;/P&gt;&lt;P&gt;But when I import the same excel files manually in ArcMap, it succeeds without error!&lt;/P&gt;&lt;P&gt;If all the script is doing is passing the files to the conversion tool (that succeeds on its own with every file), why doesn't the script execute?&amp;nbsp; &lt;/P&gt;&lt;P&gt;Is it because I don't have an exception handling procedure that the Excel to Table conversion tool needs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;arcpy.env.workspace="C:\Desktop\AP_MAP_WORKUP\Formatted_Table_Info_for_GIS"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; for file in arcpy.ListFiles("*.xl*"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename = os.path.splitext(file)[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ExcelToTable_conversion(file,filename+"_import")&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;Here is the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;Runtime error&amp;nbsp; Traceback (most recent call last):&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 3, in &amp;lt;module&amp;gt;&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\conversion.py", line 44, in ExcelToTable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e ExecuteError:&amp;nbsp; Traceback (most recent call last):&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExcelToTable.py", line 252, in &amp;lt;module&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.GetParameterAsText(2))&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExcelToTable.py", line 223, in excel_to_table&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template=tmp_table)&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 15306, in CreateTable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e ExecuteError: ERROR 999999: Error executing function. The name of the Field is invalid: valid names may contain letters, numbers or underscores. Failed to execute (CreateTable).&amp;nbsp;&amp;nbsp; Failed to execute (ExcelToTable). &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 18:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649781#M50572</guid>
      <dc:creator>MarleneSanchez</dc:creator>
      <dc:date>2016-05-31T18:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script to import Excel files</title>
      <link>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649782#M50573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At first glance, the "for" line shouldn't be indented.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 18:23:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649782#M50573</guid>
      <dc:creator>BenjaminMittler</dc:creator>
      <dc:date>2016-05-31T18:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script to import Excel files</title>
      <link>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649783#M50574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Per the error message:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;ERROR 999999: Error executing function. The name of the Field is invalid: valid names may contain letters, numbers or underscores. Failed to execute (CreateTable).&amp;nbsp;&amp;nbsp; Failed to execute (ExcelToTable).&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I would make sure all of your field names meet these requirements. You can try on a dummy file with one column meeting the criteria and one with spaces to see if it's reproducible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 18:26:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649783#M50574</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2016-05-31T18:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script to import Excel files</title>
      <link>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649784#M50575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked fine on a dummy file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's odd is that the conversion works fine with the files as they are when done manually with the Excel to Table tool in ArcMap&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 19:07:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649784#M50575</guid>
      <dc:creator>MarleneSanchez</dc:creator>
      <dc:date>2016-05-31T19:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script to import Excel files</title>
      <link>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649785#M50576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you run the conversion in arcmap is it saving to the folder in your script or is it saving the table in your default.gdb. I find fhe Excel to Table tool is always much more friendly when saving to a gdb&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 19:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-to-import-excel-files/m-p/649785#M50576</guid>
      <dc:creator>BenjaminMittler</dc:creator>
      <dc:date>2016-05-31T19:16:18Z</dc:date>
    </item>
  </channel>
</rss>

