2
What’s the difference in using Initialize
and Activate
as a Userform boot routine?
Private Sub UserForm_Initialize()
Private Sub UserForm_Activate()
2
What’s the difference in using Initialize
and Activate
as a Userform boot routine?
Private Sub UserForm_Initialize()
Private Sub UserForm_Activate()
3
Initalize occurs only once throughout the form execution so you can use, for example, to add items in a combo box, that is, to put codes that only need to be executed once before the form appears to the user. In the case of Activate, suppose you need to perform a validation every time the form is activated, in which case you would use Activate since it always runs when the form is activated
0
The Boot occurs when the object (in your case the Form) is servant. Then the code runs only once. The Activate occurs every time the form’s Activate event occurs, that is, when it receives focus, or when it is displayed after it has been hidden, or any event that activates the object.
Browser other questions tagged excel vba events userform
You are not signed in. Login or sign up in order to post.
To be quite honest, I didn’t understand your explanation! Actually, I didn’t see any difference! How do they manage in practical terms? When you must use one instead of the other?
– J. L. Muller
The Inhibit occurs only once throughout the form execution so you can use, for example, to add items in a combo box, that is, to put codes that only need to be executed once before the form appears to the user. In the case of Activate, Suppose you need to do a validation every time the form is activated, in which case you would use Activate since it always runs when the form is activated
– Vinicius B
Cool! It made more sense now! I suggest you update your response with this comment to make it more evident to the community ;)
– J. L. Muller