Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Peter Laman
 
Posts: n/a
Default How to call a macro in an XLA add-in

Hello,

This is an XLA newbie question (for Excel 2000)!

I created an Excel addin (.xla type) with a macro in it and I
installed the add-in. Then I opened another workbook, activated my VBA
form and yes, there it was, my add-in.

But now I want to create a macro in the workbook that calls a macro
from the add-in (with parameters). How can I do that? My end goal of
this is to create an add-in as a subroutine and function library for
an extensive set of Excel sheets that need to be developed.

Thanks for any help!
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

This was just 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.

Peter Laman wrote:

Hello,

This is an XLA newbie question (for Excel 2000)!

I created an Excel addin (.xla type) with a macro in it and I
installed the add-in. Then I opened another workbook, activated my VBA
form and yes, there it was, my add-in.

But now I want to create a macro in the workbook that calls a macro
from the add-in (with parameters). How can I do that? My end goal of
this is to create an add-in as a subroutine and function library for
an extensive set of Excel sheets that need to be developed.

Thanks for any help!


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
.ONACTION macro call fails Wayne Excel Discussion (Misc queries) 2 March 2nd 05 05:10 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"