<?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: Closing / Ending a mxd in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650583#M17464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, didn't think I had to state I was using ArcOBjects because I went into the ArcObjects area of the forum. Sorry about that! So since I have open document in running in this document there is no way to program the cancel button to shut it down. Right!! Would I maybe put the programming of the cancel button in ThisDocument under the open document programming. Would that work? And use what you gave me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jan 2013 17:55:41 GMT</pubDate>
    <dc:creator>MichelleCouden1</dc:creator>
    <dc:date>2013-01-07T17:55:41Z</dc:date>
    <item>
      <title>Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650574#M17455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a dialog box with a cancel button on it. I want the whole mxd to close down when they click on the Cancel button. My button is written as such :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub cmdCancel_Click()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do I type to close the mxd???&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 13:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650574#M17455</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-07T13:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650575#M17456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you want to unload the mxd then call IApplication.NewDocument.&amp;nbsp; If you want to close ArcMap itself then call IApplication.Shutdown.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 13:43:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650575#M17456</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-01-07T13:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650576#M17457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not to sure how to program that!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub cmdCancel_Click()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IApplication.Shutdown&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is how it is now and it does not shutdown the mxd..&amp;nbsp; All it does is close down the box!!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 15:28:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650576#M17457</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-07T15:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650577#M17458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;IApplication is the interface you need to use.&amp;nbsp; You will need to declare a variable of that type and set it to an instance of the ArcMap application.&amp;nbsp; Once you've done that you can call the methods you need.&amp;nbsp; How you do this depends on your environment so I'll leave that up to you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 15:35:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650577#M17458</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-01-07T15:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650578#M17459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can't do that! If you notice it is for a command button in a dialog box program. When they open the mxd a dialog box pops up in order for them to answer some questions. On the box is a cancel button, when they hit the cancel button it needs to close the mxd. So I need the code to shut down an mxd when the cancel button is pushed on the dialog box. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub cmdCancel_Click()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IApplication.Shutdown&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 17:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650578#M17459</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-07T17:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650579#M17460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You always have a way to get a reference to the ArcMap application.&amp;nbsp; If you're implementing an extension then it's passed into the Startup method.&amp;nbsp; If you're implementing a command or tool then it's passed into the Create method.&amp;nbsp; Addins have something similar but I don't work with them so I don't know it off the top of my head.&amp;nbsp; In VBA, it's a built-in environment shortcut named Application.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 17:17:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650579#M17460</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-01-07T17:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650580#M17461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I would go to ThisDocument and put this code underneath my OpenDocument?? Like Such :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Function MxDocument_OpenDocument() As Boolean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim frm As frmMapSetUp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set frm = New frmMapSetUp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frmMapSetUp.Show&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub cmdCancel_Click()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IApplication.Shutdown&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this right??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 17:35:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650580#M17461</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-07T17:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650581#M17462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're working with an Addin and you want to close ArcMap, then use the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My.ArcMap.Application.Shutdown()&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 17:44:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650581#M17462</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-01-07T17:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650582#M17463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, that is not correct.&amp;nbsp; First, you should have stated that you're using VBA to begin with so that someone trying to answer your question would know what environment you're working in.&amp;nbsp; As I said in my last post, VBA has a built-in shortcut named Application.&amp;nbsp; So the code would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Application.Shutdown()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, since you're calling your form from ArcMap's OpenDocument event you will not be able to close ArcMap or load another document because ArcMap is already in the process of opening a document.&amp;nbsp; You can only do these kind of things after the document has been loaded.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 17:44:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650582#M17463</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-01-07T17:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650583#M17464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, didn't think I had to state I was using ArcOBjects because I went into the ArcObjects area of the forum. Sorry about that! So since I have open document in running in this document there is no way to program the cancel button to shut it down. Right!! Would I maybe put the programming of the cancel button in ThisDocument under the open document programming. Would that work? And use what you gave me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 17:55:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650583#M17464</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-07T17:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650584#M17465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The mxd has loaded. You open an mxd to get the dialog box. So hitting the cancel button should close the mxd that is open at that time. Called UserForm1.mxd!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 18:07:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650584#M17465</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-07T18:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd, Sorry Neil! I am new. I'm trying to understand.</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650585#M17466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to understand. I am new to ArcObjects the language is different then VBA. When you open an mxd to get the dialog box, I am not understanding why when you hit the cancel button it can't close that mxd.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 18:18:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650585#M17466</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-07T18:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650586#M17467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know how to explain it other than to repeat what I've already said.&amp;nbsp; The OpenDocument event fires when a document is opened.&amp;nbsp; Inside this event, you are calling your form.&amp;nbsp; You cannot close ArcMap or load another document from this form because ArcMap is already in the process of opening a document.&amp;nbsp; I have tested this and each time I try it I get an Access Denied error.&amp;nbsp; If you want to close ArcMap or load another document then you will have to do it from somewhere other than the OpenDocument event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, ArcObjects is not a language.&amp;nbsp; The language you are using is VBA.&amp;nbsp; It's important to tell others this when asking a question because the vast majority of the people on this forum do not use VBA.&amp;nbsp; They use a .NET language, C++ or Java.&amp;nbsp; How you do things can vary greatly depending on your programming environment so telling people what environment you're using will get you a correct answer much faster.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 18:31:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650586#M17467</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-01-07T18:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650587#M17468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got it. Thanks again for your help!!!! Hey, since your experienced in ArcObjects could you help me with another button code. Really, I just need proper command to get to a folder than open an mxd. I am using If then statements such as this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim cboStations As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'If cboStations = "Annual" Then gotofolder "K:\TASS\4_MAPPING_DATct_Maps\2012"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'gotofolder "K:\TASS\4_MAPPING_DATA_SUPPORT\Traffic_Mapping\Urban_Maps"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'Dim districts As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Dim cboDistrict As String&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'If cboDistrict = "Abilene" Then getmxd "K:\TASS\4_MAPPe\Abilene_Base_Map.mxd"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Elif&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'cboDistrict = "Amarillo" then getmxd "K:\TASS\4_ps\2012\Amarillo"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I on the right track??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 11:52:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650587#M17468</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2013-01-08T11:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650588#M17469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having a similar problem to the one documented in this thread.&amp;nbsp; I have an inherited VBA .mxd that runs in both ArcGIS 9.3.1 and 10.0.&amp;nbsp; The .mxd uses a form that includes an Exit button.&amp;nbsp; In 9.3.1, selecting the Exit button shuts down ArcMap immediately (which is what we want).&amp;nbsp; In 10.0, the Exit button leads to the dialog box "Save changes to xxx.mxd?"&amp;nbsp; This may be minor, but I have a number of staff users who have some trouble spelling GIS, and saving changes would lead to unwanted text boxes included in subsequent iterations of the product layout (i.e. without me having to go in and clean them up).&amp;nbsp; Everything else about this .mxd works the same in 9.3.1 and in 10.0.&amp;nbsp; Wondering what else I need to do in the 10.0 version of the .mxd to get it to shutdown immediately without the dialog box.&amp;nbsp; Here is the code for the Exit button in the form:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub cmdExit_Click()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'&amp;nbsp;&amp;nbsp; Code to shutdown application&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pApp As IApplication&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pApp = Application&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'&amp;nbsp;&amp;nbsp; Do not save changes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pApp.Shutdown&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SendKeys "n"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 May 2014 17:44:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650588#M17469</guid>
      <dc:creator>BillSaunders</dc:creator>
      <dc:date>2014-05-10T17:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650589#M17470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Before calling Shutdown, try calling IDocumentDirty2.SetClean.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 12:39:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650589#M17470</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2014-05-12T12:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650590#M17471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the quick reply.&amp;nbsp; I changed the VBA code as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub cmdExit_Click()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'&amp;nbsp;&amp;nbsp; Code to shutdown application&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pApp As IApplication&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pApp = Application&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pDirty As IDocumentDirty2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pDirty.SetClean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'&amp;nbsp;&amp;nbsp; Do not save changes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pApp.Shutdown&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SendKeys "n"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the mxd gives me a Runtime Error 91 when I select the Exit button and is hanging on the .SetClean command.&amp;nbsp; Did I not implement this into VBA correctly?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 18:39:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650590#M17471</guid>
      <dc:creator>BillSaunders</dc:creator>
      <dc:date>2014-05-12T18:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650591#M17472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have to instantiate the variable pDirty before you can use it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 18:45:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650591#M17472</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2014-05-12T18:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650592#M17473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;DUH.&amp;nbsp;&amp;nbsp; Thanks.&amp;nbsp; That works great.&amp;nbsp; Now, for my info, why is this required in ArcGIS 10.0 and not in 9.3.1?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 16:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650592#M17473</guid>
      <dc:creator>BillSaunders</dc:creator>
      <dc:date>2014-05-13T16:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Closing / Ending a mxd</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650593#M17474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ESRI fixes a lot of things behind the scenes with each version release.&amp;nbsp; I can't say why they made this change in particular but I would guess it was an application design decision.&amp;nbsp; They realized calling Shutdown didn't prompt to save changes so they changed it so that it does (unless you clear the dirty flag). Again, that's just speculation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 18:21:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/closing-ending-a-mxd/m-p/650593#M17474</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2014-05-13T18:21:22Z</dc:date>
    </item>
  </channel>
</rss>

