Avatar of Saqib Husain
Saqib Husain
Flag for Pakistan asked on

Using a central macro base for all users

I generate workbooks for the timesheets of each staff member from a master workbook. This generated workbook contains some macros. Whenever I add/update the macros they are available for the staff in the following month only. I was wondering if there could be a system wherein each of the generated workbook contains a caller macro which calls a central macro in a file residing on the server so that any changes done during the month are immediately affected to all workbooks.

PS: All macros are event-fired. None of them are user-invoked. The events at the moment are worksheet_change and worksheet_selectionchange but may have to be expanded.
Microsoft Excel

Avatar of undefined
Last Comment
Saqib Husain

8/22/2022 - Mon
Rgonzo1971

Hi,

you could create an XL add-in with all procedures

refer all the events to the add-in subs, for the ones you don't yet use,  keep an empty sub

to call the add-in

 
Sub MyTest() 
    Application.Run ("myaddin.xla!mySelectionChange") 
End Sub 

Open in new window

Regards
Saqib Husain

ASKER
Is there a way for a macro to install/update the addin? I do not want to go myself to install the addin on all computers. Some people bring their own laptop and I might not be available to do the installation.
ASKER CERTIFIED SOLUTION
Rgonzo1971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Saqib Husain

ASKER
Hi, Thanks for the effort. The looks are now good. But it is going to take e some time to test it. Please bear with me while I get the time to test it.

Saqib
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Rgonzo1971

Hi,

if do not want to have your add-in centrally saved you could use

MsgBox Application.StartupPath

to get the startup folder of each user

Regards
Saqib Husain

ASKER
Sorry, I could not test it but it is time to close this now,

Thanks for everything.