I've automated my workflow using Python but I have to use "replace" in the word document and then paste it into the Python terminal. Importing "Turtle" in Python pops open a dialog box in Arc that I can then input what I would use replace with.
import sys
import turtle
def get_user_input(prompt):
if not sys.stdin:
sc = turtle.Screen();
sc.setup(0, 0);
return turtle.textinput(title='', prompt=prompt);
return input(str);
AA1 = get_user_input(prompt="Enter text here: ")
BB1 = get_user_input(prompt="Enter text here: ")
CC1 = get_user_input(prompt="Enter text here: ")
arcpy.conversion.ExcelToTable(r"AA1\BB1.xlsx", r"CC1\Table Name", "Sheet Name", 1, '')
Except when I run arcpy.conversion.ExcelToTable I end up getting an error:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\conversion.py", line 514, in ExcelToTable
raise e
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\conversion.py", line 511, in ExcelToTable
retval = convertArcObjectToPythonObject(gp.ExcelToTable_conversion(*gp_fixargs((Input_Excel_File, Output_Table, Sheet, field_names_row, cell_range), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Excel File: Dataset AA1\BB1.xlsx does not exist or is not supported
Failed to execute (ExcelToTable).
What am I doing wrong?