Forum Discussion
ber999
Jan 14, 2021Brass Contributor
Access of Text in an Excel Autoshape with vba
How can I access Text in an Excel Autoshape with vba (see worksheet in attached file)?
HansVogelaar
Jan 14, 2021MVP
For example:
Dim strText As String
strText = ActiveSheet.Shapes(1).TextFrame2.TextRange.Text
If you know the name of the shape, you can use that: change Shapes(1) to Shapes("Flussdiagramm: Prozess 1")
ber999
Jan 15, 2021Brass Contributor
Hi Hans,
this is the interesting part of the code I have used:
.
Dim exlShpOuter As Excel.Shape
.
.
Set exlWssrc=ActiveWorkbook.Worksheets.Item("AS")
.
For Each exlShpOuter In exlWsSrc.Shapes
Select Case exlShpOuter.Type
Case Office.msoLine
Case Office.msoGroup
.
.
Case Else
.
vbaText = exlShpOuter.TextFrame2.TextRange.Text
.
.
The error messagebox is attached.