Доброго времени суток всем!!подскажите чайнику почему скрипт даёт ошибку 91 в строчке
Set pFCursor = pFClass.Search(pQFilter, True)
а это сам скрипт(нашол в инете):
Public Sub DumpAttributesToFileExample()
'Open a new text file to write to
Open "c:/outfile.txt" For Output As #1
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pFLayer As IFeatureLayer
Dim pFClass As IFeatureClass
Set pMxDoc = ThisDocument
Set pMap = pMxDoc.FocusMap
'Get reference to layer in table of contents (0 is topmost layer)
Set pFLayer = pMap.Layer(0)
Set pFClass = pFLayer.FeatureClass
'Use a Query Filter to select a subset of features using
'a simple SQL where clause
Dim pQFilter As IQueryFilter
Set pQFilter = New QueryFilter
pQFilter.WhereClause = ""
'Establish a cursor used for looping
Dim pFCursor As IFeatureCursor
Set pFCursor = pFClass.Search(pQFilter, True)
Dim pFeature As IFeature
Set pFeature = pFCursor.NextFeature
'Loop thru all features and write attributes to output file
Do Until pFeature Is Nothing
'Note: below, pFeature.value(1) and pFeature.value(2) use field index numbers of the 2nd and 3rd fields in the table
'to write the values in these fields to output file. Also, the _ character continues an expression to the next line
Print #1, "Field #2 = " & pFeature.Value(1) & " and Field #3 = " & pFeature.Value(2)
Set pFeature = pFCursor.NextFeature
Loop
Close #1
End Sub