bxe6736,
Is this your real name?
The only thing I spotted with your code snippet is the line:
Dim GP As Geoprocessor = New Geoprocessor()
I think should be:
Dim GP As IGeoprocessor = New Geoprocessor()
If this does not fix your problem it would help us if you uploaded the toolbox, does the model have parameters for example as you are supplying none?
Duncan
Ok Duncan fixed half of the problem. Thanks for the heads up on the IGeoProcessor tip. Now I am getting another error on the gp.execute line:Error HRESULT E_FAIL has been returned from a call to a COM component.Here is the new code that I am using:
Dim GP As IGeoProcessor
GP = New GeoProcessor
GP.AddToolbox("C:\Documents and Settings\bxe6736\Application Data\ESRI\ArcToolbox\My Toolboxes\Toolbox.tbx")
''''Run Model 1
'' Model 1 Inputs
parameters.Add("\\Corcosaps02a\cig-eng_nt\User\PUBLIC\Public Awareness\IRTH\ISAT.mdb\ControlPointsSNG")
parameters.Add("\\Corcosaps02a\cig-eng_nt\User\PUBLIC\Public Awareness\IRTH\ISAT.mdb\ControlPointsTGP")
parameters.Add("\\Corcosaps02a\cig-eng_nt\User\PUBLIC\Public Awareness\IRTH\ISAT.mdb\tblStaticAddsTGP")
parameters.Add("\\Corcosaps02a\cig-eng_nt\User\PUBLIC\Public Awareness\IRTH\ISAT.mdb\tblStaticAddsSNG")
parameters.Add("\\Corcosaps02a\cig-eng_nt\User\PUBLIC\Public Awareness\IRTH\ISAT.mdb\ControlPointsAbandoned")
'' Model 1 Outputs
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\ControlPointsAbandoned_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\tblStaticAddsTGP_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\tblStaticAddsSNG_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\ControlPointsSNG_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\ControlPointsTGP_Copy.shp")
GP.Execute("Model3", parameters, Nothing)
parameters = Nothing
MsgBox("Model 1 Complete", MsgBoxStyle.OkOnly, "")
''''Run Model 2
'' Model 2 Inputs
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\ControlPointsAbandoned_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\tblStaticAddsTGP_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\tblStaticAddsSNG_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\ControlPointsSNG_Copy.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\ControlPointsTGP_Copy.shp")
'' Model 2 Outputs
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\Aban_OneCall_CL.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\TGP_ADD.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\TGP_CL.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\SNG_CL.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\SNG_ADD.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\TGP_OneCall_CL.shp")
parameters.Add("C:\Documents and Settings\bxe6736\Desktop\New Folder\Centerline(Local)\SNG_OneCall_CL.shp")
GP.Execute("Centerline", parameters, Nothing)
parameters = Nothing
MsgBox("Model 2 Complete", MsgBoxStyle.OkOnly, "")
Any Suggestions??Brent