I am having the same problem. I can use a field in a polygon shape file to create a raster in Spatial Analyst in ArcTools. But when I try to do the same thing programatically, with the same field, it gives me the same error you get. I am using short integer fields, and the code will work with one field and not another. If I find an answer I'll post it.
Here is the code:
Private Sub cmdPoly2Asc_Click()
'first, build the workspace
Dim pWSF As IWorkspaceFactory
Set pWSF = New RasterWorkspaceFactory
Dim pWS As IRasterWorkspace2
Set pWS = pWSF.OpenFromFile(txtPath, 0)
'next, get the features as a feature class
Dim pFC As IFeatureClass
Set pFC = pFeatLayer.FeatureClass
'set up a ConversionOp and RasterConversionOp to turn the features into a raster
Dim pRasCon As IConversionOp
Set pRasCon = New RasterConversionOp
'set up how the raster will be created
Dim pEnviro As IRasterAnalysisEnvironment
Set pEnviro = pRasCon
pEnviro.SetCellSize esriRasterEnvValue, Val(txtCellSize.Value)
'pEnviro.OutWorkspace = pWS
'since I want to use the field selected by the user, I need to use a geodataset
Dim pDS As IDataset
Set pDS = pFeatLayer.FeatureClass
Dim pGeoDataset As IGeoDataset
Set pGeoDataset = pDS
'now build a feature descriptor to make a raster
Dim pFeatDesc As IFeatureClassDescriptor
Set pFeatDesc = New FeatureClassDescriptor
pFeatDesc.Create pGeoDataset, Nothing, pField.Name '<+++++++++Crash!
'now make the rasterdataset from the features
Dim pOutRasDS As IRasterDataset
Set pOutRasDS = pRasCon.ToRasterDataset(pFeatDesc, "GRID", pWS, "TEMP")
'convert the raster dataset to an asc raster
Dim pRasterExportOp As IRasterExportOp
Set pRasterExportOp = New RasterConversionOp
Dim lcFileName As String
If Right(txtPath, 1) = "\" Then
lcFileName = txtPath & txtFileName & ".asc"
Else
lcFileName = txtPath & "\" & txtFileName & ".asc"
End If
Dim fso As Object, fldr
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder(txtPath)
If fso.FileExists(lcFileName) Then Kill lcFileName
pRasterExportOp.ExportToASCII pOutRasDS, lcFileName
Dim pRDS As IDataset
Set pRDS = pOutRasDS
pRDS.Delete
'lastly, open the asc grid and remove the header
Open lcFileName For Input As #1
Dim lcLine As String
Dim i As Long
For i = 1 To 6
Line Input #1, lcLine
Next i
Dim lcFileCont As String
Do
Line Input #1, lcLine
lcFileCont = lcFileCont & lcLine & vbCrLf
Loop While Not EOF(1)
lcFileCont = Left(lcFileCont, Len(lcFileCont) - 4)
Close
Kill lcFileName
Open lcFileName For Output As #1
Print #1, lcFileCont
Close
Set pRasterExportOp = Nothing
Set pOutRasDS = Nothing
Set pEnviro = Nothing
Set pRasCon = Nothing
Set pWS = Nothing
Set pWSF = Nothing
Set pRDS = Nothing
Set pDS = Nothing
Set pFeatDesc = Nothing
End Sub