Forum Discussion
Access of Text in an Excel Autoshape with vba
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")
- ber999Jan 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.
- ber999Jan 15, 2021Brass Contributor
Hallo Hans,
thank you very much. I have found this method at several places in the internet. But, why does not work?
- HansVogelaarJan 15, 2021MVP
Do you get an error message? If so, what does it say?
- ber999Jan 15, 2021Brass Contributor
Hi Hans,
thank you for the answer. It seems that some shapetypes have a different object model. I am looking for an object model for the Autoshapes. HansVogelaar