ExceltoTable_conversion error

4834
12
Jump to solution
01-22-2016 10:02 AM
JamesGibson
New Contributor III

I am having a problem with a simple line of python code here -- and I don't know why this is happening. There was a point in time where I did not receive this error, so I know it should work.

What I am trying to do:

Every month I get a Tax Data CD from the Tax Office, and I am trying to streamline the process of combining the ownership XLS to the Parcel Shapefile. 

I have a program I've written in VB which will allow me to select all the files necessary for the join and run the python script. (this stores the input files to a variable in an .ini file, which the python script reads the variables with ConfigParser()

taxtab.jpg

When I run the script, I get this error message:

WARNING *** OLE2 inconsistency: SSCS size is 0 but SSAT size is non-zero

WARNING *** OLE2 inconsistency: SSCS size is 0 but SSAT size is non-zero

Traceback (most recent call last):

  File "C:\Users\anotgrass\Desktop\test.py", line 8, in <module>

    arcpy.ExcelToTable_conversion (XLSInput, tableOutput)

  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\conversion.py", line 44, in ExcelToTable

    raise e

ExecuteError:

Traceback (most recent call last):

  File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExcelToTable.py", line 254, in <module>

    arcpy.GetParameterAsText(2))

  File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExcelToTable.py", line 244, in excel_to_table

    row = field.validate_value(row, workbook.datemode)

  File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Scripts\ExcelToTable.py", line 100, in validate_value

    value = xlrd.xldate_as_tuple(value, datemode)

  File "C:\Python27\ArcGISx6410.3\lib\site-packages\xlrd\xldate.py", line 80, in xldate_as_tuple

    raise XLDateAmbiguous(xldate)

XLDateAmbiguous: 1.0

Failed to execute (ExcelToTable).

I've narrowed the error down to the ExcelToTable conversion, and now have a test script solely for testing this out.

Basically, I have an XLS file that needs to be converted to a temp.dbf file, which later in the script lets me join the table to the Shapefile and create a new shapefile.

When I run this simple script, it creates the temp.DBF file,  but it doesn't finish creating it, and then I get the error message.

Does anyone know what is going on?

Thanks!

0 Kudos
12 Replies
JamesGibson
New Contributor III

Here is a stripped down version of the excel file with personal info removed, which still gives me the same error messages.  https://www.dropbox.com/s/ejcywo7vyqi9mdg/test.xls?dl=1

If anyone wanted to test using the actual file. 

XanderBakker
Esri Esteemed Contributor

It is definitely the date 1-1-1900 as mentioned here:

http://stackoverflow.com/questions/8231109/how-to-format-date-in-python-and-avoid-xldateambiguous-an...

The docs are very clear about when this is raised.

It will happen if the workbook.datemode == 0 and 1.0 <= value < 61.0

If you change the only record that has this date to a value higher than or equal to 61 (first of March 1900 for instance), the tool will run without a problem.

It is a limitation of the xlrd package used for this geoprocessing tool.

If you add the xls to the TOC and manually export the table to DBF, then it will work too, since this doesn't use Python code, but ArcObjects (not that it helps you though).

JamesGibson
New Contributor III

Thanks Xander,  I will have to come back on Monday to do some more verifying as I will not have access to my computer this weekend.

I appreciate everyone's help!

0 Kudos