Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Lars Uffmann" wrote in message ... Peter T wrote: It's an unusual way to put it, as I mentioned VBA.UserForms refers to the loaded Userforms within the project it's called from It refers to that, and a little more - by referring to a collection of those UserForms, but also providing the Add method to load new (dynamically created) forms. That's two separate things. First you dynamically created the form and return is name, say sName Second, you add it to the Userforms collection of "Loaded" forms using the Userforms.Add(sName) method. But that's not directly relevant to the fact you have just dynamically created it. If the form was created during design time you could have loaded and show'n it the same way. You could simply do Userforms.Add(sName).Show though it may well be better for later reasons to do it as you are and set a reference to the Add'ed form Generally it's best not to add code modules to the same project that's running the code. Well - I don't see how I could add the form dynamically to a different project. I mean - I could add it, but then I could not dynamically load it because I cannot access the VBA project for another project, as VBProject does not have a VBA property, sadly. I'm not saying it won't work, but look out for unexplained things happening while adding controls and related event code to the form (like the code re-compiling while running and causing a crash). Though adding code to a form is probably somewhat safer than doing similar behind a Worksheet. Regards, Peter T |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
userforms starts crashing and getting "unstable" | Excel Programming | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |