AnsweredAssumed Answered

Exporting table to Excel with unchecked fields

Question asked by uismedia on Jul 16, 2014
Latest reply on Jul 17, 2014 by Hornbydd

Hi,

 

i have a problem when exporting a table from a featurelayer with TableToExcel if the featurelayer has unchecked fields. It comes the error message RuntimeError: Cannot find field. The same works fine if no unchecked fields are available.

Here is my code snippet:

 

Dim objFLayer as IFeatureLayer = me.Layer

Dim objGP As IGeoProcessor = New GeoProcessor

Dim strOutFile As String = IO.Path.Combine(ExportFactory.GetProjectPath(ExportPathEnum.ExportPathEmbfiles),

                                           Me.ID & ".xls")

Try

    objGP.OverwriteOutput = True

 

    objParameters = New VarArray

    ' Populate the variant array with parameter values.

    objParameters.Add(objFLayer)

    objParameters.Add(strOutFile)

 

    ' Execute the model tool by name.

    Dim objResult As IGeoProcessorResult = objGP.Execute("TableToExcel_conversion", objParameters, Nothing)

Catch ex As Exception

Finally

    System.Runtime.InteropServices.Marshal.ReleaseComObject(objGP)

    objGP = Nothing

End Try

 

Someone has an idea? Thank you

 

Armin

 

Outcomes