<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: saveACopy error &amp;quot;Unable to save&amp;quot; in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/saveacopy-error-quot-unable-to-save-quot/m-p/613962#M6681</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tested this a bit further and found out a bit more.&amp;nbsp; MapDocument.saveACopy seems to embed some attribute with the output filename in both the MapDocument object and the resulting mxd file.&amp;nbsp; MapDocument.saveACopy fails when writing to this same filename.&amp;nbsp; Alternating filenames works by alternating the embedded attribute in the MapDocument object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I apparently created my test.mxd by saving a blank mxd, at some point calling mxd.saveACopy("C:/tmp/test2.mxd"), and later renaming it to test.mxd.&amp;nbsp; This explains why I only see problems with C:/tmp/test2.mxd and no other path, and only with this mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, I'm using Arc 10.1 SP1 and python 2.7.2.&amp;nbsp; ArcMap's Save, Save As, and Save A Copy do not seem to do this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Nov 2013 16:54:26 GMT</pubDate>
    <dc:creator>OliverSoong</dc:creator>
    <dc:date>2013-11-11T16:54:26Z</dc:date>
    <item>
      <title>saveACopy error "Unable to save"</title>
      <link>https://community.esri.com/t5/mapping-questions/saveacopy-error-quot-unable-to-save-quot/m-p/613960#M6679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been using saveACopy in python and have been encountering strange errors as I develop my mapping/geoprocessing scripts.&amp;nbsp; To demonstrate the problem, I saved a blank mxd to C:/tmp/test.mxd.&amp;nbsp; It appears to be important to run the examples in fresh python sessions each time.&amp;nbsp; This code: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument("C:/tmp/test.mxd")
mxd.saveACopy("C:/tmp/test3.mxd")
mxd.saveACopy("C:/tmp/test3.mxd")
mxd.saveACopy("C:/tmp/test2.mxd")
mxd.saveACopy("C:/tmp/test3.mxd")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is able to save test3.mxd the first and third times but not the second time, when if fails with error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
AttributeError: 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.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously, it's not a problem with overwriting the previous output, it's not a permissions issue, and it's not a storage space issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Separately, this code (in a fresh python session) also fails with the same error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument("C:/tmp/test.mxd")
mxd.saveACopy("C:/tmp/test2.mxd")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the same saveACopy code (in fresh python sessions each time) succeeds with C:/tmp/test3.mxd (as we've already seen), C:/tmp/tmp/test2.mxd, W:/test2.mxd, and W:/tmp/test2.mxd.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/saveacopy-error-quot-unable-to-save-quot/m-p/613960#M6679</guid>
      <dc:creator>OliverSoong</dc:creator>
      <dc:date>2021-12-12T02:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: saveACopy error "Unable to save"</title>
      <link>https://community.esri.com/t5/mapping-questions/saveacopy-error-quot-unable-to-save-quot/m-p/613961#M6680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you really want to call saveACopy to the same file name again and again (in the same script) then you will need to delete your map document variable reference that is holding onto the path.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument("C:/temp/blank.mxd")
mxd.saveACopy(r"C:/temp/test3.mxd")
del mxd
mxd = arcpy.mapping.MapDocument("C:/temp/blank.mxd")
mxd.saveACopy(r"C:/temp/test3.mxd")
del mxd
mxd = arcpy.mapping.MapDocument("C:/temp/blank.mxd")
mxd.saveACopy(r"C:/temp/test2.mxd")
del mxd
mxd = arcpy.mapping.MapDocument("C:/temp/blank.mxd")
mxd.saveACopy(r"C:/temp/test3.mxd")
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:15:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/saveacopy-error-quot-unable-to-save-quot/m-p/613961#M6680</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2021-12-12T02:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: saveACopy error "Unable to save"</title>
      <link>https://community.esri.com/t5/mapping-questions/saveacopy-error-quot-unable-to-save-quot/m-p/613962#M6681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tested this a bit further and found out a bit more.&amp;nbsp; MapDocument.saveACopy seems to embed some attribute with the output filename in both the MapDocument object and the resulting mxd file.&amp;nbsp; MapDocument.saveACopy fails when writing to this same filename.&amp;nbsp; Alternating filenames works by alternating the embedded attribute in the MapDocument object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I apparently created my test.mxd by saving a blank mxd, at some point calling mxd.saveACopy("C:/tmp/test2.mxd"), and later renaming it to test.mxd.&amp;nbsp; This explains why I only see problems with C:/tmp/test2.mxd and no other path, and only with this mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, I'm using Arc 10.1 SP1 and python 2.7.2.&amp;nbsp; ArcMap's Save, Save As, and Save A Copy do not seem to do this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 16:54:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/saveacopy-error-quot-unable-to-save-quot/m-p/613962#M6681</guid>
      <dc:creator>OliverSoong</dc:creator>
      <dc:date>2013-11-11T16:54:26Z</dc:date>
    </item>
  </channel>
</rss>

