This isn't exactly what I'm trying to do, but it's a simple example of what I'm trying to do.
There is a button on a blank workbook. When you click the button, it creates a new shape. When you click the shape, it deletes itself.
The reason I can't do this is because if I set the OnAction property of the Shape to some Sub like 'DeleteYourself', there is no way for the Sub to know which shape was clicked.
The only way I can imagine solving this is if a) somehow a Sub can know what object called it, b) you can pass an argument in the OnAction property or c) you can create new Subs with code (i.e. when the button is clicked it would create a new Sub called DeleteShapeX with X being the index number of the shape and then set that Sub to the OnAction property).
I'm pretty stumped by this one. If anyone can help I'd appreciate it.
-Mike
There is a button on a blank workbook. When you click the button, it creates a new shape. When you click the shape, it deletes itself.
The reason I can't do this is because if I set the OnAction property of the Shape to some Sub like 'DeleteYourself', there is no way for the Sub to know which shape was clicked.
The only way I can imagine solving this is if a) somehow a Sub can know what object called it, b) you can pass an argument in the OnAction property or c) you can create new Subs with code (i.e. when the button is clicked it would create a new Sub called DeleteShapeX with X being the index number of the shape and then set that Sub to the OnAction property).
I'm pretty stumped by this one. If anyone can help I'd appreciate it.
-Mike