View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Subroutine call without file reference

Run Method Example

This example shows how to call the function macro My_Func_Sum, which is
defined on the macro sheet Mycustom.xlm (the macro sheet must be open). The
function takes two numeric arguments (1 and 5, in this example).

mySum = Application.Run("MYCUSTOM.XLM!My_Func_Sum", 1, 5)
MsgBox "Macro result: " & mySum
--

John

johnf202 at hotmail dot com


"Scott" wrote in message
...
Hello, I have a master workbook(1) that opens a second
workbook(2) and I would like to call a subroutine in
workbook(2) from workbook(1). The subroutine will perform
calculations in workbook(2).

I have found a way to do this by manually setting a
reference to workbook(2) in workbook(1), but I'd like to
do it without adding a reference.

Any help is greatly appreciated.

Thanks...Scott