How can I retrieve the shape that was clicked to run a macro, without using Application.Caller?. Its name or the shape itself as an object.
I cant use Application.Caller because if the shape name is bigger than 30 characters, it retrieves only the first 30 characters.
Maybe there is an API that could retrieve the Sape object?
Edit:
- I don’t want to loop shapes in sheet. Looping throug all shapes in the workbook takes too much time.
- I can not rename the Shapes.
Thanks
Can you rename the Shape objects in your Worksheet?
Alternatively, you could manually set the .OnAction property of each shape to pass the shape name to your function:
This allows you to have Shape names over 30 characters in length. It’s kinda ugly though