Class Action (Excel VBA)

The class Action represents an action to be executed in a PivotTable or sheet data.

Set

To use a Action class variable it first needs to be instantiated, for example

Dim lngIndex As Long: lngIndex = 
Dim acts As Actions: Set acts = 
Dim actAction As Action
actAction = acts(Index:=lngIndex)

The following procedures can be used to set variables of type Action: Actions.Item, PivotCell.ServerActions, PivotValueCell.ServerActions and Range.ServerActions

For Each

Here is an example of processing the Action items in a collection.

Dim pvtlcel As PivotCell: Set pvtlcel = 
Dim actServerAction As Action
For Each actServerAction In pvtlcel.ServerActions
	
Next actServerAction

Caption

Returns the caption assigned to the Action object.

Content

Returns the content associated to the Action object.

Coordinate

Returns the coordinate property of the Action object.

Execute

Performs the specified action.

Name

Returns the name of the object.

Parent

Returns the parent object for the specified object. Read-only.

Type

Returns the action type.

Possible Values are xlActionTypeDrillthrough - Drill through, xlActionTypeReport - Report, xlActionTypeRowset - Rowset, xlActionTypeUrl - URL.

Actions.Count

Returns the number of objects in the collection.

Actions.Item

Returns an Actions object that represents a collection of actions in a workbook.

Syntax : expression.Item (Index)

Index: Index value of the action.

Actions.Parent

Returns the parent object for the specified object. Read-only.