I am working on one project. In that i want to check if chart have x or y axes or not. If not then add it. even i also want to check if x or y axes have title or not. if not then provide the title.
as i wrote one code which is checking that if x or y axes have title or not. but if not then how to add title to it?
This is a code for finding axes title
Dim oSld As Slide
Dim oShp As Shape
Dim oShapes As Shapes
Dim yaxes as Boolean
Dim xaxes as Boolean
On Error GoTo Errorhandler:
For Each oSld In ActivePresentation.Slides
Set oShapes = oSld.Shapes
For Each oShp In oShapes
If oShp.HasChart Then
If oShp.HasChart Then
yaxes = oShp.Chart.Axes(xlValue, xlPrimary).HasTitle
xaxes = oShp.Chart.Axes(xlCategory).HasTitle
'check x axies have title
If xaxes <> True Then
' Add title
End If
'check y axies have title
If yaxes <> True Then
' Add title
End If
End If
End If
Next oShp
Next
So in above code i also wants to add axes if not assign.
Thanks.
Something like this will
add axes/titles where they don’t exist