Getting Error for Excel to Table Conversion

178
5
03-30-2020 05:53 AM
SharitaUnderwood
New Contributor

I just started learning Python and now I'm trying to integrate that with my GIS knowledge. As the title suggests, I'm attempting to convert an Excel sheet to a table but I keep getting errors, one which is wholly undecipherable to me and the other which seems to be suggesting that my file does not exist which, I know is incorrect since I copied it's location directly from it's properties.

Here is a screenshot of my environment. Please help if you can and thanks in advance.

0 Kudos
5 Replies
DanPatterson_Retired
MVP Esteemed Contributor

you didn't set an output workspace, so perhaps the 'out' portion is failing.

See the code example

Excel To Table—Conversion toolbox | Documentation 

0 Kudos
SharitaUnderwood
New Contributor

Greetings and thanks for your response. I added the output workspace and am unfortunately getting the same error. Any other thoughts?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

You will have to show the edited code.

Also, if you are using full paths, make sure you are 'raw encoding them'  ie with the little r in front of the path name because there are many things that will cause paths to fail.

The J drive... hopefully not a thumb drive, some cloudy-thing or something other than a real hard drive on a your local machine?!

Next thing to try, is some other spreadsheet other than the one you want to test in case there is something wrong with that file.

Again, try an xls rather than an xlsx

I could go on, but you have many things to troubleshoot before you are done.

0 Kudos
SharitaUnderwood
New Contributor

Actually, the J drive is a hosted on the cloud. Once I saved the excel sheet locally, it worked. I don't understand why the excel sheet has to be saved locally and if you could explain, I'd appreciate that. But regardless, thank you for your help!

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

My preference is to work local and backup to the cloud.  Some people like to skip the step.  Local works, sometimes the 'cloud' doesn't (don't know why exactly... water droplets?, particulate matter? ).

Save yourself some grief and just do it.  I wouldn't even allow my students to work with stuff from One Drive or other virtual things.  Work local, backup to where-ever you want. and by local I mean you can reach inside your computer and touch the drive (ie C: or maybe even a D: drive)

In your case, your 'virtual drive (J)' worked.  What you were missing is the 'workspace' line.  You will notice that it created a *.dbf file in a folder (virtual or not).  If you had specified a file geodatabase, you would have had a gdb table.

0 Kudos