AnsweredAssumed Answered

How to save opened mxd's using ArcPy?

Question asked by yaron148 on Mar 25, 2015
Latest reply on Aug 24, 2016 by mariela06

Hi,

I work on several open mxd's and i try to save them at once with arcpy:

 

import arcpy,os,sys
import arcpy.mapping
from arcpy import env

env.workspace = r"D:\PROJECTS\bat_galim\gis"
for mxd in arcpy.ListFiles("*.mxd"):
    print mxd 
    mapdoc = arcpy.mapping.MapDocument(r"D:\PROJECTS\bat_galim\gis\\" + mxd)
    mapdoc.save()
    print 'mapdoc.save'
    counter = counter + 1
del mxd

but i get en error:

IOError: MapDocObject: Unable to save.  Check to make sure you have write access to the specified file and that there is enough space on the storage device to hold your document.

what wrong with my code?

Outcomes