Dataset does not exist or is unsupported SaveLayerToFile

by Steve Scott   Last Updated October 09, 2019 18:22 PM - source

I am trying to save a layer from an MXD to a lyrx file in a geodatabase using ArcGIS Pro.

mlist = aprx.listMaps()
infra_layers = mlist[0].listLayers()
arcpy.SaveToLayerFile_management(infra_layers[0].name, new_file_name, 'ABSOLUTE')

I am getting the following error:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Layer: Dataset active_infrastructure_projects does not exist or is not supported
Failed to execute (SaveToLayerFile).

So the name exists and the layer is being imported. Why can't it save the layer? Why is it not supported?.

Related Questions