SetFilterSRC method

SetFilterSRC method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

See also         Example         Applies to

Specifies an array of cell ranges and a True or False value indicating how to filter events for each cell range.

Version added

2002

Syntax

        
          object
          .SetFilterSRC
          SRCStream
        
      

object

Required. An expression that returns an Event object.

SRCStream

Required Integer. An array of cell ranges and a True or False value specifying how to filter events for each range.

Remarks

When an Event object created with the AddAdvise method is added to the EventList collection of a source object, the default behavior is that all occurrences of that event are passed to the event sink. The SetFilterSRC method provides a way to ignore selected events based on a range of cells.

The SRCStream argument passed to SetFilterCommands is an array defined in the following manner:

The number of elements in the array is a multiple of 7:

  • The first three elements describe the section, row, and cell of the beginning cell of the range.
  • The next three elements describe the section, row, and cell of the end cell of the range.
  • The last element contains a True or False value indicating how to filter events for the cell range (True to listen to events for a range of cells; False to exclude events for a range of cells).

For an event to successfully pass through a cell range filter, it must satisfy the following criteria:

  • It must be a valid section, row, cell reference.
  • If all filters are True, the event must match at least one filter.
  • If all filters are False, the event must not match any filter.
  • If the filters are a mixture of True and False, the event must match at least one True filter and not match any False filters.

If there are no True ranges defined in the array, events are considered True.

For example, if you want to listen for any changes in the Value cell of the second row in the Custom Property section, use the following:

  Dim srcArray (1 * 7) As Long
  srcArray(1) = visSectionProp
  srcArray(2) = visRowProp + 1
  srcArray(3) = visCustPropsValue
  srcArray(4) = visSectionProp
  srcArray(5) = visRowProp + 1
  srcArray(6) = visCustPropsValue
  srcArray(7) = True