English

Error: Method or data member not found

Error Message

Running ArcObjects code returns the following error:

"Method or data member not found."

Cause

The Set keyword is used incorrectly. Set is required to assign a property by reference and to create new objects. Set is not required when setting a property by value.

Solution or Workaround

Follow these guidelines when deciding whether or not to use Set in your code:

  • Use Set to assign a property by reference.

    Code:
    Set pPageLayout = pMxDoc.PageLayout


  • Set is not necessary when a property is assigned by value.

    Code:
    pMap.MapUnits = esriFeet


  • Set is required when creating new objects.

    Code:
    Dim pFeature as IFeature
    Set pFeature = New Feature

    Note:
    For more information on Set see the book 'Exploring ArcObjects'.