It turned out I hadn't solved the problem. But I am fairly certain I have now..
Rather than it being caused by the size of the code modules, the original error was certainly, or as certain as I can be, caused because I had exceeded the number of controls allowed on a User form.
This limit and the other limitations are explained clearly at:
http://kbalertz.com/229756/Maximum-Number-Controls.aspx
...
User Profile
Collapse
-
Hi,
I thought I would just give you an update of the progress I have made in the last week.
I finally rebuilt the form. It took me a couple of days of grind. Anyway, I cautiously imported the form – not the code associated with the form – into the version that failed and the versions I have created where I have split up the code. And surprise, surprise they all work.
So it looks like the original...Leave a comment:
-
Orally,
In the latest version that has the code into split into sub 64K chucks, I put in a special trace yesterday and one by one found three statements, that when executed, cause the error. They may be more, but I stopped after 5 hours..
They all set the back ground colour property of three different text box controls, in three different frames of my multi-page control, in the User form I added prior to the error occurring,...Leave a comment:
-
Hi,
You are perfectly correct. That is the right way to write code.
However, in this case I am writing a prototype. No one else is involved. If it gets the go-ahead to be a real application, I will probably re-write most of the code and do it properly.
At the moment, I am trying to get around a serious problem. I am trying to develop using Windows 7 and Excel 2007 and I am getting the following message:...Leave a comment:
-
Thank you for that information.
I have also discovered I can access the variables in the User form directly in Standard modules by prefixing each one with the form name. For example:
UserformName.El ementsDetailFra me.Visible = False
UserformName.El ementsGroupFram e.Visible = False
UserformName.El ementsHeadFrame .Visible = False
Which is, as far as maintining a clean structure, is not so good....Leave a comment:
-
David Wilkinson started a topic Can I access Userform variables in a standard module?in Visual BasicCan I access Userform variables in a standard module?
Hi,
I am reasonably new to Excel VBA. I have written a Userform (Wizard) with a large amount of code and I am hitting the limits of the number of lines of code or the famous undocumented limit of 64K per module.
In any case, I need to reduce the amount of code in the Userform module by placing some of the procedures and functions into Standard code modules. Unfortunately, I don't appear to have access to the Userform...
No activity results to display
Show More
Leave a comment: