How to use a subroutine stored in an add-in

  • Thread starter Thread starter lux770
  • Start date Start date
L

lux770

Hi,

I have created a module and saved it in an .xla file. I have then made
sure this add-in was launched automatically with Excel (in the Add-in
menu.)

My problem is that the subroutine contained in that module does not
appear in the macro list. It runs if I type in the full name in that
dialog box, but this is not handy especially as I want to distribute
the add-in.

I also would like to avoid assigning a keyboard shortcut or creating a
toolbar button.

How can I make sure the macro appears in the list?

Thanks
 
lux,


two things
1. is the module in the .xla an Option Module Private
&
2. does the procedure you want to run have variables delcared in the
procedure declaration

Both of those would hide the procedures
Ben
 
I think you're going to have to make a decision...

Save the workbook as a regular .xls (maybe hide it???)
Create a toolbar
Add some items to an existing toolbar
or assign shortcuts.

Personally, I like adding items to the worksheet menu bar:

I use a variation of John Walkenbach's menumaker:
http://j-walk.com/ss/excel/tips/tip53.htm
to add items to the worksheet menubar.

If I want to add a toolbar of my own, here's how I do it:
http://groups.google.co.uk/[email protected]
 
lux,

2 options
- Start macro's with Application.Run "[Myxla.xla]!mymodule.myfunction",
arg1,arg2, arg3 .....
- Set a reference in VBA IDE, tools->references, and use the functions
natively. For this the functions should be public(see other post)

Option 2 has the advantage that you do not need to load the xla
seperatly, and that you can use functions natively, and the
disadvantage that your xla might not be stored in the same place on
other computers.

Option1 has the disadvantage of no type checking but can be very
flexible if required in regard to loading xla's on demand etc.

Dm Unseen
 
Hi,

Many thanks all for your advice.
I have gone for the simple solution:
save as an .xls file, hide the workbook and move it to the XLSTART
folder.
 
Back
Top