Excel VBA: share procedures / macros with users

Hello experts,

I have multiple vba procedures which I would like to share with final users so they can re-use it when they open excel application. I was wondering what is the best way to automatically share with them those procedures. I was thinking to add all those procedures into an add-in file and then share the file however I don’t know if it is the best way.

Thank you very much for your feedback.
LVL 1
LD16Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieAnalyst Assistant Commented:
Using an add-in is probably the best way, though you might need to rewrite some of the code to ensure it targets the correct workbook.
0
LD16Author Commented:
All the procedures are related to activesheet so I will not have issue with this. Experts: is it possible to share a script example that allows to automatically add procedures in excel application?
0
Fabrice LambertFabrice LambertCommented:
All the procedures are related to activesheet so I will not have issue with this.
Highway to hell !!
What if the user click on another worksheet ?
What if the user click on another workbook ?

10 bucks your code will fail.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Roy CoxGroup Finance ManagerCommented:
When writing code for an addin you cannot code a workbook name or a worksheet name when writing the code. Therefore, it is necessary to use ActiveWorkBook or ActiveSheet. You can add a check asking the user if the correct sheet is activated or  if the there is a naming convention for the sheets to use, e.g. "Timesheet April", then something like

If Left(ActiveSheet.Name, 9) = "TimeSheet" Then
''code here
Else: MsgBox "Are you sure the correct sheet is activated?"
End If

Open in new window

0
LD16Author Commented:
Thank you very much for your help.

the question  here is to find a way to: share procedures with other users and add those procedures in excel tool bar. Is there way to do this automatically through vba?
0
Fabrice LambertFabrice LambertCommented:
Make a wokbook holding your VBA functions or an access database, and reference it.
0
Roy CoxGroup Finance ManagerCommented:
You need to create an Excel addin. Read this article about how to do this and post back with any questions.

Creating An Add-In From An Excel Macro.

There's an article and template to help you make your own Ribbon here

My First Addin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LD16Author Commented:
Roy, great links! Thank you very much for sharing!
0
Roy CoxGroup Finance ManagerCommented:
Pleased to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.