View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default call external macro

This was posted by Rob Bovey:

Application.Run "'YourAdd-in.xla'!YourSubName", Arg1, Arg2, ....

Just for completeness, if the routine is a function and you want to capture
the return value, you write it as

x = Application.Run("'YourAdd-in.xla'!YourSubName", Arg1, Arg2)

========
Another alternative would be to add a reference to your workbook that points at
your addin.

Give your addin a nice unique project name (not VBAProject) and then with your
other workbook's project active:

Tools|references|
click on that addin's project.

Then you can use your functions/subs in the addin just like they were part of
that same project.

gm139 wrote:

Does anybody know the syntax to execute
a function stored in a .XLA file.

I have tried with

[projectname].[module].functionname

but i get an error.

Thanks

--
gm139
------------------------------------------------------------------------
gm139's Profile: http://www.excelforum.com/member.php...o&userid=26951
View this thread: http://www.excelforum.com/showthread...hreadid=510211


--

Dave Peterson