![]() |
How to call a function from another workbook
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). -- Arvi Laanemets (When sending e-mail, use address arvil<Attarkon.ee) "Joe" wrote in message ... Dear sir, how can i call a function or procedure that contained in another workbook ? thanks Joe |
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 "Joe" wrote: Dear sir, how can i call a function or procedure that contained in another workbook ? thanks Joe |
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 "tjtjjtjt" wrote in message ... 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 "Joe" wrote: Dear sir, how can i call a function or procedure that contained in another workbook ? thanks Joe |
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 "Joe" wrote in message ... Dear sir, how can i call a function or procedure that contained in another workbook ? thanks Joe |
All times are GMT +1. The time now is 11:30 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com