98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Make a module available to everyone
Make a module available to everyone
Resolved · Medium Priority · Version 2003
Sarah has attended:
Excel VBA Intro Intermediate course
Access Advanced course
Access Intermediate course
Make a module available to everyone
A simple question which I've forgotten the answer to - what do I type to make a module available to all, not just that worksheet/project?
RE: Make a module available to everyone
Hi Sarah,
Thank you for your question.
You need to save the workbook as an Add-In via the File Save As command and save it to a network drive where everyone has access to.
Your colleagues then need to open Excel and go to Tools, Add-In's and then Browse for the add-in file and select it.
I hope this helps.
Regards
Simon
RE: Make a module available to everyone
Isn't there some coding to do with 'public' or 'explicit' or something like that, that goes at the top of the page?
RE: Make a module available to everyone
Hi Sarah,
Thank you for your response.
Do you mean you want the contents of the module available to other modules you have written?
If so you need to have option explicit at the top of the code which forces you to declare your variables as either private or public and declare what data they will hold such as string or integer.
Declaring variables or procedures as public means you can call and use them in all the other modules in your Project Explorer window. If you declare your variables as private(DIM) then those variables can only be called from the current module.
The answer I gave you relates to sharing the code you created with other people in your organisation. As long as you have declared your code correctly you can use this method to then share the module of code with colleagues:
1. Right click on the Module name in the Project Explorer window and choose Export File.
2. Give the file a name and the file extension will be .bas
3. Save the file on a network resource where everyone has access to it.
4. Each of your colleagues then need to open the Visual Basic Editor window(ALT+F8) and choose File and Import File.
5. Navigate to the location of the .bas file, select it and click OK.
The module of code is then copied into the Modules folder of your current workbook. This code can then be copied into the Personal macro Workbook meaning it is available to run on any file you create or open.
I hope this answers your question.
Regards
Simon
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Stop Formula Returning A "#DIV/0" ErrorIf a formula returns a #DIV/0 error message there is a way to avoid such results. |