JacobCoble

Calling a Model from ArcObjects (VBA)

Discussion created by JacobCoble on Jul 27, 2011
I have models that I would like to call from a VBA form in ArcMap 9.3.1. Using the example linked below, I can get the the "buffer_analysis" tool to open. However, when I try to set pTool to one of my models instead (as shown in the example), I get an automation error.

http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=27277

I have the line set with the model's actial name
Set pTool = pAtb.GetToolbyNameString("Model1522")
but it does not work via VBA.

If I set the script to any tool in the toolbox, for example
Set pTool = pAtb.GetToolbyNameString("buffer_analysis")
that tool opens.

Does anyone know how to get the VBA code to launch a model?

Outcomes