Bypass Looking for Template File in Mxd Document in Python

Discussion created by mvolz47 on Feb 15, 2012
Latest reply on May 23, 2013 by nfergusn
To All Python Users:

I am trying to write several python scripts that would loop through mxds in a user selected directory and either analyze the properties of the mxd or make changes to the mxd.  Unfortunately, with either type of python script, the python script crashes when it gets to an mxd that is referencing a mxt that is not on the machine where the python script is running from.

This is the message you get when you open the mxd in ArcMap.

"Unable to find the following template used by this map document:

C:\Program Files\...\layers.mxt

You can still use this map document but customizations such as macros stored in that template won't be available.  Would you like to browse to the template file to access those customizations?

Yes No"

Other than putting exceptions into the code for these mxds (there could be 100s or 1000s), I was wondering if there was a way for python to be able to bypass this message so the python script can keep running.

Any help or hints regarding this topic are greatly appreciated.  Thank you.