PDA

View Full Version : call code in a different workbook



Djblois
12-14-2007, 12:34 PM
Can workbook_A call code in Workbook_B? If it is possible, how? Also to install an addin through code, do I just copy it to the add-in folder?

Bob Phillips
12-14-2007, 12:45 PM
Application.Run "'another book.xls'!mySub"


Addins need to be 'registered' within Excel, which is not that straightforward. An alternative is to put it in the XLSTART directory, then it automatcally loads at startup, but here again, the startup directory could be in many places.

This might help

http://www.jkp-ads.com/Articles/DistributeMacro10.htm

Djblois
12-14-2007, 01:33 PM
xld,

I have this and currently it does nothing. No error and it also doesn't run the code

Application.Run "'Business Reporting Today.xlam' addtoolbar"

Bob Phillips
12-14-2007, 02:54 PM
Check what I gave against what you have.

Djblois
12-14-2007, 04:05 PM
the only difference I see is it is missing the !, however I tried that first and it also didn't do anything

Bob Phillips
12-14-2007, 04:31 PM
I haven't got 2007 on this machine, so I'll try it in the morning on my laptop.