Chart.GetChartElement (PowerPoint)

Returns information about the chart element at the specified x-coordinate and y-coordinate.

This method is unusual in that you specify values for only the first two arguments. Microsoft Word fills in the other arguments, and your code should examine those values when the method returns. The value of ElementID after the method returns determines whether Arg1 and Arg2 contain any information, as shown in the following table.

Syntax : expression.GetChartElement (X, Y, ElementID, Arg1, Arg2)

Dim lngX As Long: lngX = 
Dim lngY As Long: lngY = 
Dim lngElementID As Long: lngElementID = 
Dim lngArg1 As Long: lngArg1 = 
Dim lngArg2 As Long: lngArg2 = 
ActiveWindow.RangeFromPoint.Chart.GetChartElement X:=lngX, Y:=lngY, ElementID:=lngElementID, Arg1:=lngArg1, Arg2:=lngArg2

Arguments

The following arguments are required:

X (Long) - The x-coordinate of the chart element.

Y (Long) - The y-coordinate of the chart element.

ElementID (Long) - When the method returns, this argument contains the XlChartItem value of the chart element at the specified coordinates. For more information, see the Remarks section.

Arg1 (Long) - When the method returns, this argument contains information related to the chart element. For more information, see the Remarks section.

Arg2 (Long) - When the method returns, this argument contains information related to the chart element. For more information, see the Remarks section.