Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a problem with the Application.Run method. If you have two workbooks open, each with a code module, Application.Run seems to only work with one of the workbooks at a time and Application.Activate does not change which module's procedures will work
For example, open Excel 2000 (Book1) go to the VBA editor and type workbooks.add in the debug window. Add a module to each of the VBAprojects. Put Sub A containing msgbox("A") in one module and Sub B containing Msgbox("B") in the other. Type Call A in the immediate pane and you get "Sub or function not defined". Workbooks(1).activate does not help. Using the syntax project.module.procedure does not help either I need to call a procedure in the second Project from a procedure in the first using Application.Run(ProcName) - how do I do it? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() in my test, book2 has a sub called 'HelloWorld' from another open workbook Application.Run "book2!HelloWorld" The sub must be public (which is the default) and must be in a standard code module Patrick Molloy Microsoft Excel MVP ------------------- I Feel Great -----Original Message----- I have a problem with the Application.Run method. If you have two workbooks open, each with a code module, Application.Run seems to only work with one of the workbooks at a time and Application.Activate does not change which module's procedures will work. For example, open Excel 2000 (Book1) go to the VBA editor and type workbooks.add in the debug window. Add a module to each of the VBAprojects. Put Sub A containing msgbox("A") in one module and Sub B containing Msgbox ("B") in the other. Type Call A in the immediate pane and you get "Sub or function not defined". Workbooks(1).activate does not help. Using the syntax project.module.procedure does not help either. I need to call a procedure in the second Project from a procedure in the first using Application.Run(ProcName) - how do I do it? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Updating Workbooks from multiple links Workbooks | Excel Worksheet Functions | |||
i need help with a function application with multiple arguments | Excel Worksheet Functions | |||
Multiple Lookup Application | Excel Worksheet Functions | |||
Multiple Application.UserNames | Excel Discussion (Misc queries) | |||
Combine multiple workbooks into 1 workbook w/ multiple worksheets | Excel Discussion (Misc queries) |