View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] hooksie2@hotmail.com is offline
external usenet poster
 
Posts: 35
Default 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