>>> lyr.replaceDataSource("E:/Projects", "RASTER_WORKSPACE", "NewLayer_2010.tif") Traceback (most recent call last): File "<pyshell#20>", line 1, in <module> floodlayer.replaceDataSource("E:/Projects", "RASTER_WORKSPACE", "NewLayer_2010.tif") File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\utils.py", line 179, in fn_ return fn(*args, **kw) File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\_mapping.py", line 559, in replaceDataSource return convertArcObjectToPythonObject(self._arc_object.replaceDataSource(*gp_fixargs((workspace_path, workspace_type, dataset_name, validate), True))) ValueError: Layer: Unexpected error
I have the same problem too. My tif file name has a "." in it ("MN_Marine_on_St._Croix_20130807_TM_geo.tif"), the replacedatasource won't work! So I have to manually rename the file to make it work? Imagine I have hundreds of files... I am using 10.3.This seems to be an easy fix. ESRI, please.