Skip to content

Option Private Module causes Implicitly Public #5928

Answered by MDoerner
JustinOstrowsky asked this question in Q&A
Discussion options

You must be logged in to vote

This is intended behaviour, indeed.

What Option Private Module does is the following. Usually, public members in standard modules can be referenced from any other VBA project with a reference to the current project. When the option is set, this is no longer possible. Only other components in the current project can reference the public members in the module.
In Excel, there is the further effect that the public members no longer appear in the macros dialog.

The inspection warns about something different. If you do not specify an access modifier (Private, Public, Friend) for a member of a component, it is implicitly public, i.e. accessible from anywhere in the project. This is not affected…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JustinOstrowsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants