Hi there.I have written a script that runs a GP tool (custom python script) from a CustomUI button in ArcGIS 9.3.1 (ArcView); windows 2000.The problem is that the code runs absolutely perfectly! on this machine...I have tried moving everything to another PC (same set-up but Windows XP SP3); same folder paths; same ArcGIS install source even but the code does not run. I get a run-time error '-2147467259 (80004005)' automation error unspecified error when it tries to run the GP tool.. The tool it's self does run when launched through ArcToolbox, even if using the same parameters. I could not get the tool to run even when I isolated the toolbox code into a sub routine, and hard-coded the variables.All the same references are loaded in the document too! Does anyone have any ideas?The code is attached below in case it will help anyone help me!
Private Sub UIButtonControl1_Click()
'Create the Geoprocessor object
Dim GP As Object
Set GP = CreateObject("esriGeoprocessing.GpDispatch.1")
'Get current folder (allows for relative positioning)
Current_Folder = Left(Application.Templates.Item(Application.Templates.Count - 1), Len(Application.Templates.Item(Application.Templates.Count - 1)) - Len(ThisDocument.Title))
'open tool box
GP.Toolbox = Current_Folder & "Data\Python\zFEPS.tbx"
output_folder = "C:\temp\test\"
'Execute tools
GP.scrFepsCopyFepsFromCat "YorkshireIndex", "True", "True", "True", "True", output_folder
^^^^^^^^^ is where the code fails on my XP machine. It all works fine on my win2k machine
'mergePDFs using PDFTK (http://www.accesspdf.com/pdftk/)
(subsequent code will not have any effect - it's only shell and file system object stuff)
End Sub