Classe Action - action (Excel VBA)
La classe Action représente une action à exécuter dans un tableau croisé dynamique ou dans une feuille de données. Pour utiliser une variable de classe Action, elle doit d'abord être instanciée, par exemple
Dim act as Action
Set act = ActiveCell.PivotTable.PivotValueCell.ServerActions(Index:=1)
For Each
Voici un exemple de traitement des éléments Action dans une collection
Dim actServerAction As Action
For Each actServerAction In ActiveCell.PivotTable.PivotValueCell.ServerActions
Next actServerAction
Caption
Renvoie la légende attribuée à l’objet Action. Type de données String en lecture seule.
Dim strCaption As String
strCaption = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Caption
Content
Renvoie le contenu associé à l'objet Action. Type de données String en lecture seule.
Dim strContent As String
strContent = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Content
Coordinate
Renvoie la propriété Coordinate de l’objet Action. En lecture seule.
Dim strCoordinate As String
strCoordinate = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Coordinate
Execute
Exécute l'action spécifiée.
ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Execute
Name
Renvoie le nom de l'objet. En lecture seule chaîne.
Dim strName As String
strName = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Name
Type
Cette propriété renvoie le type d'action. En lecture seule XlActionType. Les valeurs de retour possibles sont xlActionTypeDrillthrough - Extraction, xlActionTypeReport - Rapport, xlActionTypeRowset - DSO, xlActionTypeUrl - Adresse URL.
Dim xatType As XlActionType
xatType = ActiveCell.PivotTable.PivotValueCell.ServerActions(1).Type