I am also get a error shows like "Error HRESULT E_FAIL has been returned from a call to a COM component." And the Exception snapshot shows the "stacktrace" is at "ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute". Can you help me to solve it?

The thing is that I can using the geoprocessor by C#, but can't using it by vb.net. Is it something wrong with the setting or .NET framework? Also, the Com Exception is -2147467259!

Private Sub RunBuffer()

    Dim gp As IGeoProcessor2 = New GeoProcessor()
    gp.OverwriteOutput = True
    Dim sev As Object = Nothing

        Dim parameters As IVariantArray = New VarArray()
        gp.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
        gp.SetEnvironmentValue("workspace", "C:\gp\AirportsAndGolf\golf.gdb")

        parameters.Add("1000 meters")

        gp.Execute("Buffer_analysis", parameters, Nothing)


    Catch ex As Exception
        ' Print generic exception messages.
        ' Print geoprocessing execution error messages.
    End Try

End Sub

  • That com error is E_FAIL, which is generic and not really helpful in this case. Just to eliminate some easy things, have you tried adding the toolbox that the buffer tool is in (Analysis Tools). You are already adding the Data Management Tools. Commented Jan 24, 2014 at 18:31

1 Answer 1


There are multiple Issues with your code.

Firstly, this is the old way of running Geoprocessing. You should Instead run Geoprocessing using the Managed Assembly. More Details are available in this document

Secondly, You should have correct Error Handling, which is also given in the above link.

  • Thanks for your comment. However, problem can't be solved. Actually, we can run a geoprocessing tool by using the Geoprocessing library methods or by the geoprocessor managed assembly methods. "For information about the basic differences between the two approaches, see Executing tools. In both cases, the Execute method of the geoprocessor is called". resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/…
    – huaiwei
    Commented Feb 3, 2014 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.