Jan 14 2021 06:57 AM
Jan 15 2021 07:10 AM
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)
Jan 15 2021 08:16 AM
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.
Jan 15 2021 12:45 PM
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.