Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling a Public Subroutine in a Different Workbook
I have a public subroutine called routine1() located in in workbook called
Routines.xls and I would like to call routine1() from another workbook called Book1.xls. What is the proper syntax or methodology for doing this? I'm missing something..... Thanks in advance, Raul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling a Public Subroutine in a Different Workbook
To run a sub use:
Application.Run "WorkbookName!MacroName" To run a function use: ReturnValue = Application.Run("WorkbookName!MacroName") You can add any arguments that your functions call after the macro name. The relevant xl file will have to be open though. Hope that helps, Andrew Raul wrote: I have a public subroutine called routine1() located in in workbook called Routines.xls and I would like to call routine1() from another workbook called Book1.xls. What is the proper syntax or methodology for doing this? I'm missing something..... Thanks in advance, Raul |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling a Public Subroutine in a Different Workbook
That did the trick.
Thank you very much, Raul " wrote: To run a sub use: Application.Run "WorkbookName!MacroName" To run a function use: ReturnValue = Application.Run("WorkbookName!MacroName") You can add any arguments that your functions call after the macro name. The relevant xl file will have to be open though. Hope that helps, Andrew Raul wrote: I have a public subroutine called routine1() located in in workbook called Routines.xls and I would like to call routine1() from another workbook called Book1.xls. What is the proper syntax or methodology for doing this? I'm missing something..... Thanks in advance, Raul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Subroutine question and public variables | Excel Programming | |||
calling a subroutine outside a spreadsheet | Excel Programming | |||
Function Calling Subroutine | Excel Programming | |||
Public subroutine called from a private sub | Excel Programming | |||
Calling the Solver via a subroutine | Excel Programming |