AnsweredAssumed Answered

Getting Automation Error on GP call to Erase.

Question asked by cgraham on Feb 19, 2013
Latest reply on Feb 20, 2013 by cgraham
Good Afternoon,
I am running across an issue with using the geoprocessor with Erase.  I have used this style (below) many times, and with commands that require much more complex arguments.  I can't see what I'm doing wrong.  Any help or suggestions appreciated. 

    Set pGP = CreateObject("esriGeoprocessing.GpDispatch.1")     pGP.OverwriteOutput = 1     If fso.FolderExists("C:\Program Files\ArcGIS") Then         pGP.Toolbox = "C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Analysis Tools.tbx"     Else         pGP.Toolbox = "C:\Program Files(x86)\ArcGIS\ArcToolbox\Toolboxes\Analysis Tools.tbx"     End If MsgBox "subErase - (In, Erase, Out) = " & vbNewLine & sInputLayer & vbNewLine & sEraseLayer & vbNewLine & sOutputLayer     pGP.Erase_Analyses sInputLayer, sEraseLayer, sOutputLayer     Set pGP = Nothing  


It is failing at the call to the command.  The msgbox shows that all three variables are set to valid paths.  I ran the command in the command line interface, and no problem.

I'm testing on Win7 64, ArcGIS 9.3.1, ArcINFO license.

Thanks in advance for any assistance.

Take care,
Craig

Outcomes