<?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: Problem with Application object in VBA in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-application-object-in-vba/m-p/543503#M14702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this for a quick fix:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Set pStatusBar = ThisDocument.Parent.StatusBar&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If Application appears in several more places, you could do something like the following, where you basically substitute pApp in place of Application:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim pApp As IApplication
Set pApp = ThisDocument.Parent

Set pStatusBar = pApp.StatusBar&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 23:31:53 GMT</pubDate>
    <dc:creator>TimWhiteaker</dc:creator>
    <dc:date>2021-12-11T23:31:53Z</dc:date>
    <item>
      <title>Problem with Application object in VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-application-object-in-vba/m-p/543502#M14701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a .mxd file with VBA programmed by a long-gone programmer.&amp;nbsp; It uses the Application object.&amp;nbsp; The code worked fine in ArcGIS 9 and in 10 until recently.&amp;nbsp; The only changes made since the move to ver. 10 were schema changes in the data tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;First error: ???Compile error: Method or data member not found??? occurred in the bolded code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pFeatSel As IFeatureSelection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pQueryFilt As IQueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pSelSet As ISelectionSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pLayer As IFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Set pMxDoc = Application.Document&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pMap = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pLayer = FindLayer("Parcels")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pFeatSel = pLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed Application .document to ThisDocument and it worked for that line of code, but then I got this error a few lines later:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;???Compile error: Invalid use of property???&amp;nbsp; See bolded code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pStatusBar As IStatusBar&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pProgbar As IStepProgressor&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Set pStatusBar = Application.StatusBar&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pProgbar = pStatusBar.ProgressBar&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pProgbar.Position = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are no missing references.&amp;nbsp; Does the priority order of references make a difference?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 15:50:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-application-object-in-vba/m-p/543502#M14701</guid>
      <dc:creator>SteveHempen</dc:creator>
      <dc:date>2012-01-23T15:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Application object in VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-application-object-in-vba/m-p/543503#M14702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this for a quick fix:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Set pStatusBar = ThisDocument.Parent.StatusBar&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If Application appears in several more places, you could do something like the following, where you basically substitute pApp in place of Application:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim pApp As IApplication
Set pApp = ThisDocument.Parent

Set pStatusBar = pApp.StatusBar&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-with-application-object-in-vba/m-p/543503#M14702</guid>
      <dc:creator>TimWhiteaker</dc:creator>
      <dc:date>2021-12-11T23:31:53Z</dc:date>
    </item>
  </channel>
</rss>

