Run macro from a different workbook

[Closed]
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
Hello,

i have a workbook for a particular client with all macros in that workbook. i might get a new client for which a seperate workbook will b created. i need to have one common workbook with all macros present which can be used across all clients.

3 replies

There is a workbook called personal.xls in your main folder. In my computer it is in folder
C:\Program Files\Microsoft Office\Office10\XLStart

if not available you open an excel workbook and give a name---personal.xls-- and save it in this folder.
perhaps it may be available in any other xlstart folder.
As it is in xlstart folder the workbook will also open when you open any excel workbook but personal.xls will be hidden. unhide this workbook and park your macros in the veditor of this file. and again save and hide the personal.xls file. The macros will be available for all the workbooks.
Hi thanks a lot...

does it have to be only personal.xls or can i have any workbook.

the idea is to have this "personal" workbook to hold all the codes

there can be many clients and each client has its own workbook.

so when excel starts there shud be a custom menu listing all clients. on selecting a client that particular workbook should be opened and all the macros in the personal workbook shud run.

the processes for all the clients are the same. so i dont want to have same codes on each and every workbook and if any changes are required then i need to change code in all the workbooks.
hi thanks a lot...

does it have to be only personal.xls or can i have any workbook.

the idea is to have this "personal" workbook to hold all the codes

there can be many clients and each client has its own workbook.

so when excel starts there shud be a custom menu listing all clients. on selecting a client that particular workbook should be opened and all the macros in the personal workbook shud run.

the processes for all the clients are the same. so i dont want to have same codes on each and every workbook and if any changes are required then i need to change code in all the workbooks.
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
802
This is a new problem for me. You have a separate workbook for each client (e.g personaA) Now yu do NOT park in xlstart folder but any other folder. There can be an event code in the clients operating workbook(NOT personalA) that when it opens the other workbook personalA also opens and even hidden In such a case all the macros of ALL the open workbooks including those in perosnalA are available.

Try some such trick