Can macro/procedure be stored externally?

hon

Board Regular
Joined
Oct 10, 2005
Messages
73
Just want to find out if it is possible to store a macro/procedure externally(globally) so that any excel work book can run it.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
Hi

IT can be stored as an addin, or in the personal.xls workbook. Both of these will allow any book to run them. Another alternative would be to create a DLL.....


Tony
 

hon

Board Regular
Joined
Oct 10, 2005
Messages
73
Hi Tony

Could you please give me some examples on how to achieve it? I would like to be able to maintain just one global macro so that any changes to it are immediately available to all workbooks referencing it.

thanks
Hon
 

hon

Board Regular
Joined
Oct 10, 2005
Messages
73

ADVERTISEMENT

Tony, it is good stuff. I am almost there. I just want to know if it is possible to have that personal.xls stored on the network so that I don't have to copy it to everyone's PC.
 

hon

Board Regular
Joined
Oct 10, 2005
Messages
73
Another question. I created a macro and stored it in personal.xls. But how do I reference it in another workbook?
 

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814

ADVERTISEMENT

Hi

I don't think you can use the personal.xls for general consumption. YOu will have to use an addin (not too sure about this). If you have the addin on a network, then each user will have to enable it in the tools, addins. To reference things from a macro, go tools, references and bring in the addin. It can then be a normal call.


Tony
 

hon

Board Regular
Joined
Oct 10, 2005
Messages
73
Hi Tony

Forget about the network issues. Is it still possible to call the macro stored in the personal.xls from the active workwork?

Thanks
Hon
 

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,345
yuo can call a macro from another file like this
Code:
Application.Run ("personal.xls!macroname")
 

Watch MrExcel Video

Forum statistics

Threads
1,130,447
Messages
5,642,209
Members
417,262
Latest member
andrewd1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top