I am now looking for a code in VBA that can call Tools from ArcToolBox(The little red box)
I have find a Arcobject code(I thought it's can run under VBA) but it's don't work!
I have to delete the URL here....
in the end of the page it's have Arcobject code
But it's don't work!
can anyone tells me how to use it?
thanks for the help!!
@ Mike Toews
Compile error:
Sub or Function not defined
at OpenPointDataset
@artwork21 I call it from Tools>marcos>visual basic editor It's a simple compiler in GIS not a ui control
I have tried the method with the page http://edndoc.esri.com/arcobjects/9.0/Samples/Geoprocessing/RunToolWithGPDispatch.htm
and I try my Kriging Tool
Sub RunGPTool()
'Create the Geoprocessor object
Dim GP As Object
Set GP = CreateObject("esriGeoprocessing.GpDispatch.1")
'Set the toolbox
GP.Toolbox = "C:\Program Files\ArcGIS\ArcToolBox\Toolboxes\Spatial Analyst Tools.tbx"
'Execute tools
GP.Kriging "C:\sample.shp", _
"F30", "C:\AA\456.shp", "250", "12"
End Sub
but it's highlight error at GP.Kriging "C:\sample.shp", _ "F30", "C:\AA\456.shp", "250", "12"
and says
automation error
unspecified error
how to fix it??
update 2011/06/11 10:00PM(+8)
@Casey
http://edndoc.esri.com/arcobjects/9.0/Samples/Geoprocessing/RunToolWithGPDispatch.htm
in this page
there is no "_analysis"in the sample code...
and I tried GP.Kriging_sa
but it's still don't work....
thanks for you support!
by the way I have tried buffer it's works!!