Class Action (Excel VBA)
The class Action represents an action to be executed in a PivotTable or sheet data. To use a Action class variable it first needs to be instantiated, for example
Dim act as Action
Set act = ActiveCell.PivotTable.PivotValueCell.ServerActions(Index:=1)
For Each
Here is an example of processing the Action items in a collection.
Dim actServerAction As Action
For Each actServerAction In ActiveCell.PivotTable.PivotValueCell.ServerActions
Next actServerAction
Caption
Returns the caption assigned to the Action object.
Dim strCaption As String
strCaption = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Caption
Content
Returns the content associated to the Action object.
Dim strContent As String
strContent = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Content
Coordinate
Returns the coordinate property of the Action object.
Dim strCoordinate As String
strCoordinate = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Coordinate
Execute
Performs the specified action.
ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Execute
Name
Returns the name of the object.
Dim strName As String
strName = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Name
Type
Returns the action type. Possible return values are xlActionTypeDrillthrough - Drill through, xlActionTypeReport - Report, xlActionTypeRowset - Rowset, xlActionTypeUrl - URL.
Dim xatType As XlActionType
xatType = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Type