Link to home
Create AccountLog in
Microsoft Excel

Microsoft Excel

--

Questions

--

Followers

Top Experts

Avatar of Steve_Brady
Steve_BradyπŸ‡ΊπŸ‡Έ

Excel VBA code location, ThisWorkbook vs. Module
Hello,

What is the difference between VBA code inserted in ThisWorkbook and a Module? Β I've seen it both ways.

Thanks

Β User generated image

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of DaveDaveπŸ‡¦πŸ‡Ί

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

SOLUTION
Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

SOLUTION
Avatar of patrickabpatrickabπŸ‡¬πŸ‡§

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of NorieNorie

Patrick

Does that work for subs declared Private?

Avatar of patrickabpatrickabπŸ‡¬πŸ‡§

imnorie,

>Does that work for subs declared Private?

By 'that' I assume you mean referencing the sub by the code pane it is in.

No, it doesn't work for 'Private' subs.

Patrick

Thought so, just wanted to check.

Sorry for not being clear.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of C_sharp_beaverC_sharp_beaverπŸ‡¨πŸ‡¦

The main point where to put code is security issue of code

If you want hide (protect) code from user - create separate .XLA file and keep code in it's modules (protected by password)

So user will be able to create his own macro but don't have access to yours

The main point of where to put code might be to put it somewhere where it will work.:)

Avatar of Steve_BradySteve_BradyπŸ‡ΊπŸ‡Έ

ASKER

multiple good answers

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of patrickabpatrickabπŸ‡¬πŸ‡§

Steve - Thanks for the points - Patrick
Microsoft Excel

Microsoft Excel

--

Questions

--

Followers

Top Experts

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.