

This is called the default instance of the class (also called the "magic form" The behavior (or invisible statement) serves to declare (and tell VBA to load on first use) an object variable, called UserForm1, of type UserForm1.

The following statement is made a part of the project:
Excel for mac forms are modal code#
However, the special userform class behaves as if somewhere invisible to the code window, Just as for any other class or object, like this: A default instance of the UserForm1 class is created.Ī general instance of the class can be declared and created.A new special class UserForm1 is created.When you insert and create a userform in a new project, two things occur: My purpose is to try to explain both, offer my preference, but let you decide which method is best for you.Ī userform definition is an object definition that contains the form (what you see) and a class module (the "machinery" behind what you see). Both have avid supporters and both have fierce critics.

The two terms paired off in the heading above are what I chose to call the two methods of initializing a userform in a project. My goal in publishing these notes and tips is to spare other VBA enthusiasts, who may chance to find them, some of the angst and mystification that I've experienced over the years with userforms in general and these topics in particular. Why? Because as these are advanced notes and tips, I'm not 100% certain that I am smart enough or even qualified to present them properly. I started it four or five years ago, then lost interest, and then dusted it off to try to finish it at least a dozen times. This Microsoft Word Tips & Microsoft Word Help page has been a long time in preparation.
