I want to loop over all shapes in a chart in an excel file.
This works in principle with
Dim currChart As Chart
Set currChart = Sheets("Diagramm 1")
Dim sShapes As Shape
For Each sShapes In currChart.Shapes
Debug.Print sShapes.name
Debug.Print sShapes.TextFrame.Characters.Text
Next sShapes
However, the property TextFrame
is not known by all type of shapes. therefore I want to test if a shape has a textframe. How can I do that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…