Mapping Visual Basic

T

Tim

I am looking for an article on the basic layout of VBA. Maybe a map
would work. More specifically, when you edit a macro, there are 3
panels that open. The Projects, Properties, and the panel that says
Normal-NewMacros (code). The third one I have a handle on but the
Projects one is what I am trying to figure out. Finally, what are the
form, modules, and class modules for under "The Projects" panel?
 
D

Daiya Mitchell

You can see #3 here, which offers a little (I can't tell if you are already
beyond that level):
http://word.mvps.org/MacWordNew/InstallMacroMac.htm
(hit refresh a few times in Safari, or use a different browser)

And somebody else will likely be along with a more sophisticated
explanation, as I am pretty much a VB novice. Basically, macros are stored
in modules, and modules are stored in documents or templates. For some
reason the VB Editor refers to documents/templates as Projects (actually,
documents seem to be Projects and templates are TemplateProjects).

Forms/Class Modules I am not familiar with and have never needed to
investigate, but they are created via the Insert menu and appear to have a
similar purpose to regular modules. For instance, I don't have any Forms or
Class Modules because I have never inserted any--the default setting is just
for Normal to have one NewMacros module, as far as I know.
 
J

JE McGimpsey

Tim said:
I am looking for an article on the basic layout of VBA. Maybe a map
would work. More specifically, when you edit a macro, there are 3
panels that open. The Projects, Properties, and the panel that says
Normal-NewMacros (code). The third one I have a handle on but the
Projects one is what I am trying to figure out. Finally, what are the
form, modules, and class modules for under "The Projects" panel?

This link may help (it applies to XL/VBA, but for most of your purposes,
the information is transferable):

http://www.mcgimpsey.com/excel/modules.html

Projects are the Visual Basic term that includes VB modules (regular
code modules, user forms, class modules) and documents/templates
associated with applications (e.g., Word).

Each Project will have at least a Document and Document-level class
module. If you add regular code module(s) or userform(s), the project
will contain those as well.

You use the Projects window to select which project/module you're
working on. By default, your code is added to a regular code module in
the Normal template (the Normal-NewMacros module). Macros in a template
are available to all documents that have that template attached. You can
also attach a module to a document, so that it's available only when
that document is open.

The Properties window is used to display/set the properties of the
selected object. When a module is selected, the module's properties are
selected. If a userform is selected, the properties window will show the
userform or component properties (i.e., button color, text, size, etc.).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top