PDA

View Full Version : Autorun externally held macro without opening external file



Asterix
05-15-2008, 02:13 AM
Hi all, is there anyway that I could open a spreadsheet, that automatically runs a macro (via "autorun" obviously) where the macro (or a called subroutine) is held in a separate, closed, repository, WITHOUT having to open that repository.

Am asking because I have several replicated spreadsheets that belong to individuals in my team and I have the same autorun macro in each. Problem is, when I need to fix or enhance the autorun macro, I'm doing it 10 times.

I could store that macro centrally and have the individual sheets refer to it, but I don't necessarily want whatever holds that macro to be opened when it runs.

Although I think I'm asking the impossible (as you have to open a macro container to run a macro), am I wrong/ can this be done?

Any other suggestions gladly considered.

Thankyou

Bob Phillips
05-15-2008, 03:10 AM
Don't think so.

Sounds to me that you should have the macro in a code workbook. maybe an addin, and run it from there.

R1C1
05-15-2008, 05:54 AM
Your choices are:

Locate the code module in the Personal.xls on each user's computer.

Save a workbook, with the code module, as an Add-In and install on each user's computer.

Locate the code module in a workbook located on a shared drive and run the macros from there.

I use the last method. Yes it opens the workbook with the code but it makes it easily accessible to my co-workers. I use Auto_Open to load a toolbar pointing to the macros. The remote users open the workbook and install the toolbar. They now have access to my macros and if I need to modify or enhance the macro, I do it in one loction without the user even knowing it took place. They only see the results each time they run the macro.

Alan

Asterix
05-16-2008, 12:21 AM
Thanks both.