Delete object shape name
How do I delete a shape object? Here's the skinny. Let's say I have three Rectangle shape objects on sheet1 which I have added. Each having a text name of shape1 shape2 & shape3. I believe Excel uses a different naming scheme like ... Rectangle 1, Rectangle 2 & Rectangle 3.
When I programmatically delete the shapes, I have to reference the shape names as Rectangle 1,2 or 3 which works! I see when the shapes are deleted. However, If I create three more shape of the same type(rectangle) and want to delete them, I can no longer reference them as Rectangle 1,2 or 3. I have to use Rectangle 4,5 or 6. This leads me to believe that I only graphically deleted the shapes but not the shape names from Excel's shape name counter(or what ever is keeping count of the number of shape(types) created). So more specifically, how do I programmatically delete a shape name such that when I create another shape object of the same type, Excel begins to count it as... for example, Rectangle 1 again? Any ideas?
|