So I exported the code from a model builder model in ArcGIS Pro 3.1. I then opened the code in VScode to firstly see whether the code is running fine from VScode or not.
So the code fails where it has to read an xlsx file, even though the file does exist in the location path defined.
Is this a path issue? How can I fix this?
Error:
ERROR 000732: Input Excel File: Dataset \bc\efs\PowerBI\EPGMD\INNOVATION UNIT\CulturalArts\Grants.xlsx does not exist or is not supported
Code line:
Grants_xlsx = "\\bc\efs\PowerBI\EPGMD\INNOVATION UNIT\CulturalArts\Grants.xlsx"
# Process: Excel To Table (Excel To Table) (conversion)
Grants_ExcelToTable = "O:\\psd\\Ed\\GeocodeProject\\ModelGeodatabase.gdb\\Grants_ExcelToTable"
arcpy.conversion.ExcelToTable(Input_Excel_File=Grants_xlsx, Output_Table=Grants_ExcelToTable, Sheet="Grants")
File location:
Question | Analyze | Visualize