Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to execute the smoothpolygon tool within ArcMap vba and I'm having some trouble defining the parameters syntax for the tool. I'm getting this error below:

ERROR 000622: Failed to execute (mooth Polygon). Parameters are not valid.
ERROR 000628: Cannot set input into parameter tolerance.

Here is my code, thanks for your help!

Private Sub SmoothGeo_Click()

    Dim filePath As String
    filePath = "C:\Projects\OSU_Well_Buffer_Tool\USDE\USDE.mdb"
    Dim inputName As String
    Dim clipName As String
    inputName = "buffer9_smu"

    Dim pGP As Object
    Set pGP = CreateObject("esriGeoprocessing.GPDispatch.1")

    On Error GoTo EH
    pGP.Workspace = filePath
    ' note: the inputs can also be objects; however the output must be a string.
    pGP.smoothpolygon_management filePath + "\" + inputName, "C:\Projects\OSU_Well_Buffer_Tool\USDE\USDE.mdb\smooth", "1", "PAEK", "150"

    Exit Sub
    MsgBox pGP.GetMessages(), vbOKOnly, "Test"
End Sub 
share|improve this question
Edited code formatting. – Petr Krebs Dec 27 '10 at 20:47
i haven't done vba in a long time, but i thought string concatenation was with & not + – gotchula Dec 27 '10 at 21:10
@gotchula: That's right. Must be VB.NET then.. – Petr Krebs Dec 27 '10 at 23:43
Try using a full unit string for tolerance, so "1 meter" versus "1". – Jason Scheirer Dec 28 '10 at 5:27
Added a vb tag. – djq Dec 28 '10 at 12:38

A better way to execute tools in VB, VBA, or .NET is to use the IGeoProcessor interface, rather than the dispatch object.

This link will take you to a sample of using the IGeoProcessor in VB/VBA to execute tools and return the tool messages:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.