Automation error while using Model (.tbx) in ArcObjects

Discussion created by nitinbele18 on Jul 14, 2011
I am  facing problem in accesessing custom toolbox from a network drive.The code is in VBA and it gives me automation error when I try to access any Geoprocessing tool.

Dim pUID As New UID
pUID = "esriGeoprocessingUI.ArcToolboxExtension"
Dim pATBE As IArcToolboxExtension
Set pATBE = Application.FindExtensionByCLSID(pUID)
Dim pTool As IGPTool
Set pTool = pAtb.GetToolbyNameString("ModelName")
Dim pComm As IGPToolCommandHelper
pComm.SetTool pTool
pComm.Invoke Nothing

Any pointers ?