I am using the following script in the python window in ArcMap 10.5.1 desktop to export a layout to a PDF. It works perfectly the first time, but after that then there is no reaction, no error message, nothing. I have tried changing Geoprocessing > Geoprocessing Options so that Overwrite the output of geoprocessing operations is enable but this seems to make no difference.
Why might this be happening?
mxd = arcpy.mapping.MapDocument("CURRENT") arcpy.mapping.ExportToPDF(mxd, r"C:\Mapsfolder\20191010-0056875154.pdf") del mxd