I am attempting to update a layer's data source in Arcmap using python
for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
if lyr.name == "project_whl":
lyr.replaceDataSource("F:\\Jobs2012\\05665\\EPASS\\", "SHAPEFILE_WORKSPACE","1205992_whl")
This WORKS!
HOWEVER I would like to use a wildcard instead of explicitly stating the dataset_name
Example below:
for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
if lyr.name == "project_whl":
lyr.replaceDataSource("F:\\Jobs2012\\05665\\EPASS\\", "SHAPEFILE_WORKSPACE","*whl")
Yet does not work, I have tried *, ?, %, _, & none of these work...
Just get the following error message
<type 'exceptions.ValueError'>: Layer: Unexpected error
Your thoughts, ideas?
