Looping Through Layers in Mxd and Saving Mxd Changes Extent

Discussion created by mvolz47 on May 21, 2013
Latest reply on Oct 8, 2013 by mvolz47
To All Python Users:

I have a script that loops through all the layers in an mxd and then saves the mxd.  I have found that when I open up the saved mxd the extent of the map in the data view has changed even though I did not write code for the extent to change.  Has anyone come across this phenomenon before?

The problem I am finding is that the layout view, that could be setup for a print job, has changed.  Now the user has to go back and fix the extent for the layout to be printed correctly.  I am eventually looking to run this script on many mxds in batch and I do not want to disrupt all the mxds where the endusers need to go back and fix the extent.

Why would the map extent change if all I am doing is looping through the layers in a python script?