VBScript code cannot run under ArcGIS 10

738
5
10-14-2011 08:30 AM
YaoShen1
New Contributor
My VBScript code can run under ArcGIS9.3.1, but not under ArcGIS 10

' Create the Geoprocessor object
set gp = WScript.CreateObject("esriGeoprocessing.GPDispatch.1")
gp.AddToolbox "C:/Program Files/ArcGIS/Desktop10.0/ArcToolbox/Toolboxes/Conversion Tools.tbx"

Error Information
Error: Could not create object named "esriGeoprocessing.GPDispatch.1"
Source: WScript.CreateObject


Thank you
0 Kudos
5 Replies
NobbirAhmed
Esri Regular Contributor
Do you have VBA license installed? In 10, you need to install license separately. Request support for the license.
0 Kudos
YaoShen1
New Contributor
Thank you very much for your reply:)

I can run VBA code in ArcGIS10 now. The VBScript code came from Model Builder. I made models in ArcGIS 9.3, then I exported as VBScript. But in 10, the Model Builder can't export VBScript code any more. It only supports Python Script... :(



Do you have VBA license installed? In 10, you need to install license separately. Request support for the license.
0 Kudos
ChrisFox3
Regular Contributor II
Is the machine that has ArcGIS 10 64 bit? If so check out the following KB article:

VBScript and JScript geoprocessing scripts do not run on a 64-bit Windows OS
0 Kudos
YaoShen1
New Contributor
Thanks:o

But it is 32-bit Windows XP:(

Is the machine that has ArcGIS 10 64 bit? If so check out the following KB article:

VBScript and JScript geoprocessing scripts do not run on a 64-bit Windows OS
0 Kudos
JakubSisak
Regular Contributor II
gp.AddToolbox "C:/Program Files/ArcGIS/Desktop10.0/ArcToolbox/Toolboxes/Conversion


I beleive the location of toolboxed is incorrect. I think this is new to version 10.  The path to toolboxes on my machine is: "C:\Users\UserName\AppData\Roaming\ESRI\Desktop10.0\ArcToolbox\My Toolboxes"
0 Kudos