Run AML ARC commands from ArcCatalog or ArcMap

Last Published: April 25, 2020


Create VBA code with the ODE references 'ESRI Arc automation server' and 'ESRIutil automation server' and run an AML using the Command method.


  1. Open the VBA editor in ArcMap.
  2. In the VBA editor Tools menu, click References.
  3. Check the 'ESRI Arc automation server' and 'ESRIutil automation server'.
  4. Instantiate an ODE ESRI.Arc object and an ESRIutil.Strings object.

    Dim Arc1 As ESRI.Arc
    Dim Results As ESRIutil.Strings
    Set Results = New ESRIutil.Strings
    Set Arc1 = New ESRI.Arc

  5. Send the &RUN directive to the ESRI Arc automation server through the Command method of the ESRI.Arc object.

    Dim ArcStatus As Long
    Dim command1 As String
    command1 = "&run c:\testdir\demo.aml"
    ArcStatus = Arc1.Command(command1, Results)
    MsgBox "AML complete."

    AML's that switch to other modules such as Tables or Arcedit, require a different VBA coding strategy.

Article ID:000002300

  • ArcMap 8 x
  • ArcMap 9 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic