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 15, 2021MVP
I did see the screenshot (and I understand German), but that doesn't help. I'd need to see (a copy of) the workbook.
ber999
Jan 15, 2021Brass Contributor
Hi Hans,
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.
- ber999Jan 15, 2021Brass Contributor
- HansVogelaarJan 15, 2021MVP
You can test whether a shape has text: change
vbaText = exlShpOuter.TextFrame2.TextRange.Text
to
If exlShpOuter.TextFrame2.HasText Then vbaText = exlShpOuter.TextFrame2.TextRange.Text End If
- ber999Jan 16, 2021Brass Contributor
Hi Hans,
it works good. But, there must at least one shape without text exist which is not visible to me and not handled by the select cases instructions above else.
HansVogelaar