![]() |
Calling procedures of a different project
I have different VBA procedures in different workbooks and I need to call a
procedure from one workbook to another. How can I do this? How is the right syntaxis? I appreciate any help. -- Jorge De la Rosa |
Calling procedures of a different project
Application.Run "'another book2.xls'!test_msgbox"
as an example -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jorge De la Rosa" wrote in message ... I have different VBA procedures in different workbooks and I need to call a procedure from one workbook to another. How can I do this? How is the right syntaxis? I appreciate any help. -- Jorge De la Rosa |
Calling procedures of a different project
Thank you for you help!.
It worked well -- Jorge De la Rosa "Bob Phillips" wrote: Application.Run "'another book2.xls'!test_msgbox" as an example -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Jorge De la Rosa" wrote in message ... I have different VBA procedures in different workbooks and I need to call a procedure from one workbook to another. How can I do this? How is the right syntaxis? I appreciate any help. -- Jorge De la Rosa |
Calling procedures of a different project
Another method is to set a reference from the workbook that needs to call
the function to the workbook that contains the function. In the VBA editor, open the workbook that contains the functions. Go to the Tools menu and choose "VBA Project Properties". In that dialog, change the name from "VBAProject" to something meaningful, like "MyFunctions". Save that workbook. Then open the workbook that is going call upon the functions, go to the Tools menu, choose References, and select "MyFunctions" in the list. Once you have that reference in place, you can call functions in the "MyFunctions" project as if they were native VBA functions, without any qualifiers. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "Jorge De la Rosa" wrote in message ... I have different VBA procedures in different workbooks and I need to call a procedure from one workbook to another. How can I do this? How is the right syntaxis? I appreciate any help. -- Jorge De la Rosa |
Calling procedures of a different project
Thanks for your help. I already try this way and work fine.
-- Jorge De la Rosa "Chip Pearson" wrote: Another method is to set a reference from the workbook that needs to call the function to the workbook that contains the function. In the VBA editor, open the workbook that contains the functions. Go to the Tools menu and choose "VBA Project Properties". In that dialog, change the name from "VBAProject" to something meaningful, like "MyFunctions". Save that workbook. Then open the workbook that is going call upon the functions, go to the Tools menu, choose References, and select "MyFunctions" in the list. Once you have that reference in place, you can call functions in the "MyFunctions" project as if they were native VBA functions, without any qualifiers. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "Jorge De la Rosa" wrote in message ... I have different VBA procedures in different workbooks and I need to call a procedure from one workbook to another. How can I do this? How is the right syntaxis? I appreciate any help. -- Jorge De la Rosa |
All times are GMT +1. The time now is 11:21 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com