View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
IT_roofer IT_roofer is offline
external usenet poster
 
Posts: 45
Default Number of UserForm Control Objects

Hey Chip,

Thanks for the reply. I tried the tool and it did... something, but it
didn't fix my issue. The issue seems to come into play when I put in or
remove a frame that contains 57 controls... or at least that's what print
UserForm1.Controls.Count says in the immediate window. When I add that frame
into it's original position and try to edit the code, it says "Out of
memory". I take it out and it's fine; I can access the code. The main pages'
name is 'projectinfo' - a print projectinfo.controls.count reveals 1155
objects without the other frame. I'm starting to think there's a 1200 count
control object limitation...


"Chip Pearson" wrote:

After extensive editing, and especially on large projects, VBA doesn't
properly clean up its internal code storage areas. They get filled with junk
code. It is nothing that you are doing wrong, but rather VBA not cleaning up
after itself. The solution is to export all code out to text files, delete
all the code in the project, and then finally import the code back from the
text files. This causes VBA to start with a "clean slate" and can cure any
number of strange problems. Rob Bovey has a free add-in called "VBA Code
Cleaner" that automates all this down to a two mouse clicks. See
http://www.appspro.com/Utilities/CodeCleaner.htm .

Rob's Code Cleaner is one of the "must have" add-ins for serious
development.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)



"IT_roofer" wrote in message
...
Does anyone know if there is a limit to the number of Control Objects
someone
can have on a UserForm?

I ran into an "Out of memory (Error 7)" error today after adding in a few
Labels and Textboxes to a project I'm working on. I added in my objects
and
went to edit the code behind them and it wouldn't let me add code. I
shuffled
my code from the userform into different modules in an effort to eliminate
the number of lines of code and that wasn't working. I finally moved a few
frames that contained a bunch of objects into new userforms and that did
the
trick.

Any ideas?