DataChange 事件

expandtri全部显示

当在指定的数据透视表视图中某个属性发生更改,或某些方法被执行时,该事件发生。

Private Sub Form_DataChange(ByVal Reason As Long)

Reason 可以使用 PivotDataReasonEnum 常量的值,来确定触发该事件的原因。

PivotDataResonEnum 可以是下列 PivotDataResonEnum 常量之一:

plDataReasonAdhocFieldAdded

plDataReasonAdhocFieldDeleted

plDataReasonAdhocMemberChanged

plDataReasonAllIncludeExcludeChange

plDataReasonAllowDetailsChange

plDataReasonAllowMultiFilterChange

plDataReasonAlwaysIncludeInCubeChange

plDataReasonCommandTextChange

plDataReasonConnectionStringChange

plDataReasonDataMemberChange

plDataReasonDataSourceChange

plDataReasonDisplayCalculatedMembersChange

plDataReasonDisplayCellColorChange

plDataReasonDisplayEmptyMembersChange

plDataReasonExcludedMembersChange

plDataReasonExpressionChange

plDataReasonFieldNameChange

plDataReasonFieldSetDeleted

plDataReasonFieldSetNameChange

plDataReasonFilterContextChange

plDataReasonFilterCrossJoinsChange

plDataReasonFilterFunctionChange

plDataReasonFilterFunctionValueChange

plDataReasonFilterOnChange

plDataReasonFilterOnScopeChange

plDataReasonGroupEndChange

plDataReasonGroupIntervalChange

plDataReasonGroupOnChange

plDataReasonGroupStartChange

plDataReasonIncludedMembersChange

plDataReasonInsertFieldSet

plDataReasonInsertTotal

plDataReasonIsFilteredChange

plDataReasonIsIncludedChange

plDataReasonMemberPropertyDisplayInChange

plDataReasonMemeberPropertyIsIncludedChange

plDataReasonOrderedMembersChange

plDataReasonRecordChanged

plDataReasonRefreshDataSource

plDataReasonRemoveFieldSet

plDataReasonRemoveTotal

plDataReasonSortDirectionChange

plDataReasonSortOnChange

plDataReasonSortOnScopeChange

plDataReasonSubtotalsChange

plDataReasonTotalAllMembersChange

plDataReasonTotalDeleted

plDataReasonTotalExpressionChange

plDataReasonTotalFunctionChange

plDataReasonTotalNameChange

plDataReasonTotalSolverOrderChange

plDataReasonUnknown

plDataReasonUser

示例

下面的示例说明了捕获 DataChange 事件的子程序的语法。为了使该示例奏效,必须设置一个对 Microsoft Office Web Components 10.0 类型库的引用。

Private Sub Form_DataChange(Reason As Long)

   If Reason = OWC.plDataReasonDisplayCellColorChange Then

        MsgBox "The cell display color was changed."

    End If

End Sub