0

I have a very big dataset in a gbd. I would like to export it to an excel file. I use the following code:

startingP = r"C:\Directory\ArcGIS\By_Coding.gdb\MyInput"
endingP = r"C:\Directory\ArcGIS\By_Coding.gdb\Output.xls"
arcpy.TableToExcel_conversion (startingP,endingP)

But what I get is:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type

I have already seen in another question that it was suggested to combine arcpy.TabletoExcel_conversion with other tools like ListDatasetand with MakeTableView_managementbut it sounds weird to me that there is no faster way to do it, because I always thought the arcpy functions perfectly replicated the corresponding Arcgis toolbox tools, and if I use Arctoolbox > Conversion Tools > Excel > Excel to Table using the input file "MyInput" as "Input Table", it works. Is therefore any mistake in the way I call my variables in the code?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked May 19, 2016 at 16:04
3
  • save it to your desktop or somewhere else besides the GDB and it should work Commented May 19, 2016 at 16:15
  • Thank you that was indeed the problem, but why python does not like the gdb as output directory? Commented May 19, 2016 at 16:22
  • when you used the tool from arctoolbox were you able to save the .xls into your GDB? Commented May 19, 2016 at 16:38

1 Answer 1

2

I think your problem is that you're trying to save your output in your geodatabase. Change endingP to:

endingP = r"C:\Directory\ArcGIS\output.xls"

And see if that works.

answered May 19, 2016 at 16:13
2
  • It was! Thank you a lot! I was so sure the problem was in my input file and not in the output directory, but I was focusing on the wrong problem. But why does it not accept the geodatabase as a valid output directory? Commented May 19, 2016 at 16:19
  • I know that some python functions don't work well with Arc's geodatabases, they're unable to read them, so I suspect it's something similar going on here too. For example: desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/… Commented May 19, 2016 at 16:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.