Re: Macro file organization

From: shockley (shocklee_at_frontiernet.net)
Date: 03/25/04


Date: Thu, 25 Mar 2004 06:31:55 GMT

Fred,

Some non-expert ideas:
One good reason for multi-modules is variable declaration: Variables and
constants declared as "Private" at the top of a module are "module-level",
i.e., they are not recognized outside of the module in which they are
declared, so this can be a useful way of organizing and utililzing your
project's variables.

Another advantage of multi-modules is it allows you to organize your macros
according to some kind of personal scheme or theme. You may want to put all
or most functions within one module, or, perhaps, your frequently-called
special-task sub-routines, or a set of macros that, together, accomplish a
discrete part of the larger job that is the project (this dovetails with the
variable-scope idea).

When editing or creating your project, skipping back and forth between
macro's, the VBEditor remembers and returns you to the part of the 'page'
(i.e., module) that you were on when you clicked away, so this is a
convenience that saves searching and scrolling within a module. Similarly,
the text-search function of the VBEditor has the option of being module- or
project- specific, so this confers more power to a multi-module approach.
Also, if you are good at remembering which module has which parts of your
code (and you will remember better if the project is organized organically),
there is less scrolling when searching for a part of your code, if the code
is broken up into modules.

I haven't used this one much, but by exporting/saving a module, you can give
it a custom name that will appear in the module list (instead of the generic
module1, module2...) when it is imported back in.

Shockley

"Fred Smith" <fredsmith99@yahoo.com> wrote in message
news:OHY85igEEHA.1556@TK2MSFTNGP10.phx.gbl...
> What's the recommended way of organizing macro files?
>
> I've developed a set of reasonably long procedures (six procedures at 200
> lines each). Right now, they are all in Module1 of the VBE.
>
> Is this what most people do? When do you go from a module to a project
> (which is something I've never used, but am willing to learn).
>
> --
> Thanks,
> Fred
> Please reply to newsgroup, not e-mail
>
>
>



Relevant Pages

  • Re: Bob Flannagan
    ... Nathan, ... declaration takes precedent over global declarations. ... what is telling you that it is reset? ... Productivity add-ins and downloadable books on VB macros for Excel ...
    (microsoft.public.excel.programming)
  • Re: Convert C-Builder program to Delphi?
    ... > compatibilty with DLLs. ... It is a macro and depends on C preprocessor macros being textual; ... Delphi does not have them all next to each other and doesn't have ... quite separate from the function declaration itself. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Convert C-Builder program to Delphi?
    ... > compatibilty with DLLs. ... It is a macro and depends on C preprocessor macros being textual; ... Delphi does not have them all next to each other and doesn't have ... quite separate from the function declaration itself. ...
    (comp.lang.cpp)
  • Re: [ Attn: Randy ] Ad-hoc Parsing?
    ... unless 'Agaga' is defined as a macro elsewhere. ... at all, but simply a _Declaration_, from the simple ... Code, Macros, Equates, Nested Macros, Equates of Equates, ...
    (alt.lang.asm)

Loading