Issues to work with Excel files with arcPy!!

4482
13
09-22-2015 08:05 AM
SaidAkif
New Contributor III

Hi all

I tried to convert excel sheets to table. I did the folowing:

code1.PNG

the problem that I got a message 000732 that imput table table .....\file.xlsx\'ATL...$' does not exist or not supported (makeTableView).

the list (Listxls) is well populated. Moreover, I tried the same work at home and it work fine. I really don't know what happen?

Any help please?

By the way, I hve lot of trouble to use this webside. I can't copy/paste anything. My interface is :

code2.PNG

Thanks in advance

0 Kudos
13 Replies
SaidAkif
New Contributor III

Hi all

I realize just right now that in the message error, the name of the file contain 2 times the Excel file name which is i believe the source of the error.

I Tried all combinaison, but the error happen all the time

Any Idea

Thanks

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Said, In 10.2.2/10.3 I have been successful

arcpy.ExcelToTable_conversion(FileXLS, outFGDBtable)

But my process is a little different in that I'm also creating the Excel file from a .csv to start with, so only one tab.  But I would look more into that command to see if it would work

Excel To Table—Help | ArcGIS for Desktop

0 Kudos
SaidAkif
New Contributor III

Unfortunaitly, I work with 10.1 version

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

have you tried TableToTable?

ArcGIS Help 10.1

Syntax

TableToTable_conversion (in_rows, out_path, out_name, {where_clause}, {field_mapping}, {config_keyword})

0 Kudos
SaidAkif
New Contributor III

Hi

Thanks I used this TableToTable as you mention (the same way). but I still having the same error. As I mention before, the problem is the duplication of the Excel file name (...xlsx) in the valeur variable (please see my first message)

Thanks

0 Kudos
JamesCrandall
MVP Frequent Contributor

What are you expecting the output "table(s)" to be exactly?

I see you set an "outGDB" variable, but that is only pointing to the folder not an actual Geodatabase.

"tablename" is going to output what type of file exactly?  I don't see where you are specifying any file extension anywhere.  The source doc says you would be just creating INFO table outputs without any extensions supplied.

http://resources.arcgis.com/EN/HELP/MAIN/10.1/index.html#//001200000027000000

0 Kudos
SaidAkif
New Contributor III

Hi all,

Sorry I use the image link because I have trouble to copy/paste in this website. So here is the code and th message erro. You can see that the priblem is in the input table.

Thanks for your help

code3.PNG

0 Kudos
WesMiller
Regular Contributor III

MakeTableView_management (in_table, out_view, {where_clause}, {workspace}, {field_info})

arcpy.MakeTableView_management(valeur,os.path.join(outGDB,tableName,".dbf"))

0 Kudos
SaidAkif
New Contributor III

Hi

I try this but the same Error. The problem is in the duplication Excel table name in the input table as showen in the ERROR message. I don't know why this error happen

Thanks

0 Kudos