thank you very much. I have copied the Autoshape at the attached sheet from a worksheet with hundreds of different shapes. My vba code did not work there with the Autoshapes only.
I have found code for Powerpoint Autoshapes. The access method is different there (see below).
Dim shpTextArray() As Variant
Dim numShapes, numAutoShapes, i As Long
Set myDocument = ActivePresentation.Slides(1)
numShapes = .Count
If numShapes > 1 Then
numTextShapes = 0
ReDim shpTextArray(1 To 2, 1 To numShapes)
For i = 1 To numShapes
If .Item(i).HasTextFrame Then
numTextShapes = numTextShapes + 1
shpTextArray(numTextShapes, 1) = .Item(i).Name
shpTextArray(numTextShapes, 2) = .Item(i) _
ReDim Preserve shpTextArray(1 To 2, 1 To numTextShapes)
this is the interesting part of the code I have used:
Dim exlShpOuter As Excel.Shape
For Each exlShpOuter In exlWsSrc.Shapes
Select Case exlShpOuter.Type
vbaText = exlShpOuter.TextFrame2.TextRange.Text
The error messagebox is attached.
I have tested the my code with the worksheet and the single Autoshape. And, it works. Consequently, the problem should be the structure of the worksheet. However, the worksheet in question is not for public use. So, I will try to find a solution.