AnsweredAssumed Answered

My "ExportToPDF" Python scripts no longer work

Question asked by scott_mcgee_fws on Oct 2, 2018
Latest reply on Jan 15, 2019 by dailya

I have some Python scripts that export MXDs to PDFs. I initially created the scripts when we were using ArcGIS 10.5.x and they worked just fine - no errors.


We recently upgraded to 10.6.1 and now the scripts blow up with the following errors:


Traceback (most recent call last):
  File "T:\", line 45, in <module>
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\", line 182, in fn_
    return fn(*args, **kw)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\", line 1156, in ExportToPDF
AttributeError: PageLayoutObject: Error in executing ExportToPDF


I've triple-checked to make sure there are no syntax errors, misspellings, or other errors in my scripts. Like I said, they used to work perfectly in 10.5.x, but not now in 10.6.1. I looked at the code in the Python scripts that are mentioned in the error message above, but I have no idea what to look for to try to fix the issue with my ExportToPDF scripts.


Any ideas?