Select to view content in your preferred language

How to realize tool of the Arctoolbox with VBA?

698
1
Jump to solution
07-19-2013 10:21 AM
RustamSultonov
New Contributor
Help me realize Arctoolbox's tool Split Line At Vertices (Data Management) with VBA.
How can I do this in VBA?
0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Honored Contributor
Help me realize Arctoolbox's tool Split Line At Vertices (Data Management) with VBA.
How can I do this in VBA?


Unless you have an outdated version of ArcGIS and plan on staying with that version for a really long time, VBA should be considered dead as a language used to develop tools for ArcGIS.  It is nearly impossible to find the old help that applied to VBA for initializing the geoprocessor object and running a tool and I have largely forgotten how to do it since using that approach is that out of date.  So unless you provide a compelling reason for why you cannot convert to something else, bite the bullet, stop VBA development, and start migrating your code.

Python or .Net should be the approach you look into.  Python is easiest if you are just doing geoprocessing, since the tool can be run with arcpy at 10.0 or later or with the geoprocessor object for several earlier versions and the Python forum is filled with examples of how to use geoprocessor tools.  Normally you just import arcpy and use the tool syntax description given in the help for the tool preceded with arcpy.*.  Using .Net is recommended if you are using advanced GUI forms or need to develop a program that has full ArcObjects control of Desktop or other GIS applications.  Here is the help for using the geoprocessor to run a tool in .Net.  The VB.Net help would come the closest to what you would do using VBA, but syntax differences would have to be backward converted, which if you are going to convert syntax, go the other way to move to .Net.

View solution in original post

0 Kudos
1 Reply
RichardFairhurst
MVP Honored Contributor
Help me realize Arctoolbox's tool Split Line At Vertices (Data Management) with VBA.
How can I do this in VBA?


Unless you have an outdated version of ArcGIS and plan on staying with that version for a really long time, VBA should be considered dead as a language used to develop tools for ArcGIS.  It is nearly impossible to find the old help that applied to VBA for initializing the geoprocessor object and running a tool and I have largely forgotten how to do it since using that approach is that out of date.  So unless you provide a compelling reason for why you cannot convert to something else, bite the bullet, stop VBA development, and start migrating your code.

Python or .Net should be the approach you look into.  Python is easiest if you are just doing geoprocessing, since the tool can be run with arcpy at 10.0 or later or with the geoprocessor object for several earlier versions and the Python forum is filled with examples of how to use geoprocessor tools.  Normally you just import arcpy and use the tool syntax description given in the help for the tool preceded with arcpy.*.  Using .Net is recommended if you are using advanced GUI forms or need to develop a program that has full ArcObjects control of Desktop or other GIS applications.  Here is the help for using the geoprocessor to run a tool in .Net.  The VB.Net help would come the closest to what you would do using VBA, but syntax differences would have to be backward converted, which if you are going to convert syntax, go the other way to move to .Net.
0 Kudos