How to call a function from another workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear sir,
how can i call a function or procedure that contained in another workbook ?

thanks
Joe
 
Hi

When you want to use an UDF or procedure in several workbooks, then save it
into a module of Personal Macro Workbook (Personal.xls, it's created
automatically, when you select Personal Macro Workbook as destination to
save a newly-created macro, and later is loaded automatically whenever you
start Excel).
 
One way:
You can also create a Reference between the two workbooks (if they are both
open) from the Tools Menu. To make the reference, both the files should be
open. After that, only the workbook you are using has to be open.

tj
 
After that, only the workbook you are using has to be open.

The workbook which is referenced must be open; Excel will
typically open it automatically for you.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
You can use Application.Run. E.g.,

Applicaiton.Run "Workbook1.xls!TheSub
' or
Result = Application.Run ("Workbook1!TheFunction,1,2,3)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top