mvidas
06-13-2007, 11:33 AM
Hi All,
Not exactly an excel question, really applies to any office userform. This is just our busiest forum :)
I'm adding a bunch of controls at runtime to my userform, and I need access to their _click events. I know how to do this if I were to use a class module, and I will probably end up doing that, but I'm really hoping to keep all the code in the userform itself.
I know I could just put in a bunch of _click events in hopes that the number I add never goes above the pre-coded events, but I'm hoping for something better.
Since I can't use control arrays in VBA, does anyone know a tricky way of doing this? Though I don't know of it, I'm hoping there something like:controls("controlname").assignevent "click", "myclickevent"
And in reality, this is for outlook, which has no VBE access so I can't even go that route.
If you know for sure that there is no such thing, please post that too. I think chances are I'm just gonna have to deal with a class module for the time being (until I go the com add-in route).
Not exactly an excel question, really applies to any office userform. This is just our busiest forum :)
I'm adding a bunch of controls at runtime to my userform, and I need access to their _click events. I know how to do this if I were to use a class module, and I will probably end up doing that, but I'm really hoping to keep all the code in the userform itself.
I know I could just put in a bunch of _click events in hopes that the number I add never goes above the pre-coded events, but I'm hoping for something better.
Since I can't use control arrays in VBA, does anyone know a tricky way of doing this? Though I don't know of it, I'm hoping there something like:controls("controlname").assignevent "click", "myclickevent"
And in reality, this is for outlook, which has no VBE access so I can't even go that route.
If you know for sure that there is no such thing, please post that too. I think chances are I'm just gonna have to deal with a class module for the time being (until I go the com add-in route).