Skip to main content
edited tags
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

ArcPy: Excel to Table Conversion on multiple Excel files in a folder using ArcPy gives ERROR 000814

I am trying to convert all of xls files (including single sheet) a folder into dbf tables in a gdb.

Here is my code:

import arcpy, os, xlrd
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Excel is input, gdb is output directories

excel = "C:/Users/****/Desktop/Assignment_5/excel_files"
gdb = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Walk through the folder for all xls files and convert them to dbf files

for root, dirs, files in os.walk(gdb):
    for f in files:
        outname = gdb + str(os.path.basename(f[:-4])) + ".dbf"
        arcpy.ExcelToTable_conversion(f, outname)
            

What I get in shell is nothing more than this:

Traceback (most recent call last):
  File "Y:/students/***/Assignments/Assignment_5/Assignment_5.py", line 32, in <module>
    arcpy.ExcelToTable_conversion(f, outname)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\conversion.py", line 63, in ExcelToTable
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type
Failed to execute (ExcelToTable).

What is the problem is with my code? I have gone through all websites, but could not figure this out!

ArcPy: Excel to Table Conversion on multiple Excel files in a folder

I am trying to convert all of xls files (including single sheet) a folder into dbf tables in a gdb.

Here is my code:

import arcpy, os, xlrd
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Excel is input, gdb is output directories

excel = "C:/Users/****/Desktop/Assignment_5/excel_files"
gdb = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Walk through the folder for all xls files and convert them to dbf files

for root, dirs, files in os.walk(gdb):
    for f in files:
        outname = gdb + str(os.path.basename(f[:-4])) + ".dbf"
        arcpy.ExcelToTable_conversion(f, outname)
            

What I get in shell is nothing more than this:

Traceback (most recent call last):
  File "Y:/students/***/Assignments/Assignment_5/Assignment_5.py", line 32, in <module>
    arcpy.ExcelToTable_conversion(f, outname)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\conversion.py", line 63, in ExcelToTable
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type
Failed to execute (ExcelToTable).

What is the problem is with my code? I have gone through all websites, but could not figure this out!

Excel to Table Conversion on multiple Excel files in folder using ArcPy gives ERROR 000814

I am trying to convert all of xls files (including single sheet) a folder into dbf tables in a gdb.

Here is my code:

import arcpy, os, xlrd
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Excel is input, gdb is output directories

excel = "C:/Users/****/Desktop/Assignment_5/excel_files"
gdb = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Walk through the folder for all xls files and convert them to dbf files

for root, dirs, files in os.walk(gdb):
    for f in files:
        outname = gdb + str(os.path.basename(f[:-4])) + ".dbf"
        arcpy.ExcelToTable_conversion(f, outname)
            

What I get in shell is nothing more than this:

Traceback (most recent call last):
  File "Y:/students/***/Assignments/Assignment_5/Assignment_5.py", line 32, in <module>
    arcpy.ExcelToTable_conversion(f, outname)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\conversion.py", line 63, in ExcelToTable
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type
Failed to execute (ExcelToTable).

What is the problem is with my code?

Bumped by Community user
Bumped by Community user
edited tags; edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
removed helpme
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

ArcPy: Excel to Table Conversion on multiple excelExcel files in a folder

I am trying to convert all of xls files (including single sheet) a folder into dbf tables in a gdb.

Here is my code:

import arcpy, os, xlrd
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Excel is input, gdb is output directories

excel = "C:/Users/****/Desktop/Assignment_5/excel_files"
gdb = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Walk through the folder for all xls files and convert them to dbf files

for root, dirs, files in os.walk(gdb):
    for f in files:
        outname = gdb + str(os.path.basename(f[:-4])) + ".dbf"
        arcpy.ExcelToTable_conversion(f, outname)
            

What I get in shell is nothing more than this:

Traceback (most recent call last):
  File "Y:/students/***/Assignments/Assignment_5/Assignment_5.py", line 32, in <module>
    arcpy.ExcelToTable_conversion(f, outname)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\conversion.py", line 63, in ExcelToTable
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type
Failed to execute (ExcelToTable).

What do you guys thinkis the problem is with my code? I have gone through all websites, but could not figure this out! Please help!

ArcPy: Excel to Table Conversion on multiple excel files in a folder

I am trying to convert all of xls files (including single sheet) a folder into dbf tables in a gdb.

Here is my code:

import arcpy, os, xlrd
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Excel is input, gdb is output directories

excel = "C:/Users/****/Desktop/Assignment_5/excel_files"
gdb = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Walk through the folder for all xls files and convert them to dbf files

for root, dirs, files in os.walk(gdb):
    for f in files:
        outname = gdb + str(os.path.basename(f[:-4])) + ".dbf"
        arcpy.ExcelToTable_conversion(f, outname)
            

What I get in shell is nothing more than this:

Traceback (most recent call last):
  File "Y:/students/***/Assignments/Assignment_5/Assignment_5.py", line 32, in <module>
    arcpy.ExcelToTable_conversion(f, outname)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\conversion.py", line 63, in ExcelToTable
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type
Failed to execute (ExcelToTable).

What do you guys think the problem is with my code? I have gone through all websites, but could not figure this out! Please help!

ArcPy: Excel to Table Conversion on multiple Excel files in a folder

I am trying to convert all of xls files (including single sheet) a folder into dbf tables in a gdb.

Here is my code:

import arcpy, os, xlrd
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Excel is input, gdb is output directories

excel = "C:/Users/****/Desktop/Assignment_5/excel_files"
gdb = "C:/Users/****/Desktop/Assignment_5/excels.gdb"

# Walk through the folder for all xls files and convert them to dbf files

for root, dirs, files in os.walk(gdb):
    for f in files:
        outname = gdb + str(os.path.basename(f[:-4])) + ".dbf"
        arcpy.ExcelToTable_conversion(f, outname)
            

What I get in shell is nothing more than this:

Traceback (most recent call last):
  File "Y:/students/***/Assignments/Assignment_5/Assignment_5.py", line 32, in <module>
    arcpy.ExcelToTable_conversion(f, outname)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\conversion.py", line 63, in ExcelToTable
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type
Failed to execute (ExcelToTable).

What is the problem is with my code? I have gone through all websites, but could not figure this out!

deleted 194 characters in body
Source Link
Loading
deleted 28 characters in body
Source Link
Loading
Source Link
Loading