O'Reilly logo

Writing Word Macros, Second Edition by Steven Roman PhD

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Public and Private Procedures

Just as variables and constants have a scope, so do procedures. We can declare a procedure using the Public or Private keyword, as in:

	Public Function AddOne(i As Integer) As Integer

or:

	Private Function AddOne(i As Integer) As Integer

The difference is simple: a Private procedure can be called only from within the module in which it is defined, whereas a Public procedure can be called from within any module in the project.

Note that if the Public or Private keyword is omitted from a procedure declaration, then the procedure is considered to be Public.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required