Hi all,
Is it possible to 'remotely' trigger a userform click event after the userform has loaded?
I have two separate excel files: file 'A.xlsb' and 'B.xlsm', each has a userform, 'a' and 'b' respectively.
File 'A' has a shape in Sheet1 that loads userform 'a'.
File 'B' has a shape in Sheet1 that loads userform 'b'.
Here is where I'm at:
When I click the shape in file 'A', userform 'a' is loaded. In it I click a button that loads userform 'b', using Run method, but I cannot get the click event of a button in userform 'b' to work (I don't know how). However I have noticed that if I place a msgbox line after the code that runs the macro to shows userform 'b' (i.e. Run method), the message would only show up AFTER the userform closes. The msgbox appears to suspend as VBA awaits for the line that loaded the form 'b' to 'finalize', and only then go on to the next line of code.
How then can I both trigger userform 'b', set some params in it (fill it out) and then 'click' on one of its buttons, all programmatically?
I need to run a few automated form fill outs instead of having to manually fill out form 'b' a dozen times or so.
(I think I may not even need to show the form itself in order to do that, but I do need the data to go through that form and have a button in it to enter the data to file 'B' 'cause the button does a bunch of stuff with the data before that data is dumped in sheet1 of file 'B'.)
Thanks!
Bookmarks