Chart.HasAxis property (Word)

Returns or sets which axes exist on the chart. Read/write Variant.

Syntax

expression.HasAxis (Index1, Index2)

expression A variable that represents a Chart object.

Parameters

Name Required/Optional Data type Description
Index1 Optional Variant The axis type. Series axes apply only to 3D charts. Can be one of the XlAxisType constants.
Index2 Optional Variant The axis group. 3D charts have only one set of axes. Can be one of the XlAxisGroup constants.

Remarks

You must enter a value for at least one of the parameters when you set this property.

Microsoft Word may create or delete axes if you change the chart type or the AxisGroup property.

Example

The following example enables the primary value axis for the first chart in the active document.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.HasAxis(xlValue, xlPrimary) = True 
 End If 
End With 

See also

Chart Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.