Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default how to "synchronize" VBProjects & VBA.Userforms?


"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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
userforms starts crashing and getting "unstable" pswanie Excel Programming 0 February 25th 08 08:36 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 12:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"