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:
Solved! Go to Solution.
Hey @Ed_
In your error I see that the first \ in your line isn't showing as double, you may try this:
Grants_xlsx = r"\\bc\efs\PowerBI\EPGMD\INNOVATION UNIT\CulturalArts\Grants.xlsx"
This may take in the second \.
Hope that helps!
Cody
Hey @Ed_
In your error I see that the first \ in your line isn't showing as double, you may try this:
Grants_xlsx = r"\\bc\efs\PowerBI\EPGMD\INNOVATION UNIT\CulturalArts\Grants.xlsx"
This may take in the second \.
Hope that helps!
Cody
Yup that did it, cheers for the super quick response 🙂