I wrote the script below to iterate through a file geodatabase's feature classes and convert them to an excel table. However, it returns the error
ExecuteError: Failed to execute. Parameters are not valid.ERROR 000814: Invalid file typeFailed to execute (TableToExcel)I converted the feature classes to table views but I can't figure out what is wrong with the paramaters. The error is at line 18, which is where the arcpy.TableToExcel_conversion('table', outname) operation begins.
import arcpyfrom arcpy import envdbSpace = arcpy.GetParameterAsText(0)env.workspace = dbSpaceparish = arcpy.GetParameterAsText(1)for fc in arcpy.ListFeatureClasses(): if arcpy.Exists('table'): arcpy.Delete_management('table') arcpy.MakeTableView_management(fc, 'table') outname = fc.replace(".","_") outpath = str(outname + parish) arcpy.TableToExcel_conversion('table', outname) arcpy.AddMessage('Created "{}" Table export '.format(fc))arcpy.Delete_management('table')
أكثر...
ExecuteError: Failed to execute. Parameters are not valid.ERROR 000814: Invalid file typeFailed to execute (TableToExcel)I converted the feature classes to table views but I can't figure out what is wrong with the paramaters. The error is at line 18, which is where the arcpy.TableToExcel_conversion('table', outname) operation begins.
import arcpyfrom arcpy import envdbSpace = arcpy.GetParameterAsText(0)env.workspace = dbSpaceparish = arcpy.GetParameterAsText(1)for fc in arcpy.ListFeatureClasses(): if arcpy.Exists('table'): arcpy.Delete_management('table') arcpy.MakeTableView_management(fc, 'table') outname = fc.replace(".","_") outpath = str(outname + parish) arcpy.TableToExcel_conversion('table', outname) arcpy.AddMessage('Created "{}" Table export '.format(fc))arcpy.Delete_management('table')
أكثر...