Calling Macro Visual Basic Procedures of a Different Project
Sponsor
Excel Macro Vba Calling macro visual basic procedures of a different project [Q]
I have different excel macro VBA procedures in different excel 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.
Excel Macro Vba Calling macro visual basic procedures of a different project [A]
Application.Run “‘another book2.xls’!test_msgbox”
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 excel 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.
Rate This Tips:
Incoming excel search terms
,excel vba call,mss,excel vba call procedure in another workbook,strings procedures and macros,vba call macro,call macro from another project,excel vba call procedure,vba call another macro,call macro from different workbook,excel macro call another macro,excel vba call procedure from another worksheet,how to call a function from another project vba excel,vba call function,vba call sub from another project,call macro from other project,call macro in vba,call procedure from different sheet,excel vba call module,excel vba procedure,excel vba reference another workbook,excel vba run procedure on another form,how to call macro from other project,strings procedures & macros,vba call function other project,call macro excel,call procedure in excel vba,call sub vba,call vb from vba,calling macro in excel,excel macro,excel macro call macro,excel vba basics,excel vba call another macro,excel vba call function in another project,excel vba call macro,excel vba calling procedure,excel vba run function in another workbook,excel vba run macro in another workbook,vb excel procedures,vb6 call module from another workbook,vba call procedure from another project,vba calling macro from different project,vba calling procedures,vba excel call procedure from another project,visual basic call macro,2h,activate macro in another workbook,add reference to different workbook excel vba,basic vba for excel
Related Excel Tips
Comments
One Comment on Calling Macro Visual Basic Procedures of a Different Project
-
Demgar on
Wed, 28th Apr 2010 8:57 am
The main drawback of APPLICATION.RUN, aside from the fact that it’s very verbose, is that it won’t pass objects as arguments.
For anything past a very trivial complexity level, setting a reference is the way to go.
Have another excel answer or questions for this problem ?
Feel free to post it here..














