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)?
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.
ber999
Jan 15, 2021Brass Contributor
- HansVogelaarJan 15, 2021MVP
You can test whether a shape has text: change
vbaText = exlShpOuter.TextFrame2.TextRange.Textto
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- HansVogelaarJan 16, 2021MVP
Does that happen in your sample workbook? If so, where should I look?