Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to use a subroutine stored in an add-in


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


--
lux770
------------------------------------------------------------------------
lux770's Profile: http://www.excelforum.com/member.php...o&userid=24970
View this thread: http://www.excelforum.com/showthread...hreadid=384969

  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default How to use a subroutine stored in an add-in

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

--
When you lose your mind, you free your life.


"lux770" wrote:


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


--
lux770
------------------------------------------------------------------------
lux770's Profile: http://www.excelforum.com/member.php...o&userid=24970
View this thread: http://www.excelforum.com/showthread...hreadid=384969


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default How to use a subroutine stored in an add-in

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/groups?th...5B41%40msn.com



lux770 wrote:

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

--
lux770
------------------------------------------------------------------------
lux770's Profile: http://www.excelforum.com/member.php...o&userid=24970
View this thread: http://www.excelforum.com/showthread...hreadid=384969


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default How to use a subroutine stored in an add-in

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to use a subroutine stored in an add-in


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.


--
lux770
------------------------------------------------------------------------
lux770's Profile: http://www.excelforum.com/member.php...o&userid=24970
View this thread: http://www.excelforum.com/showthread...hreadid=384969

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
Call a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
SUBROUTINE HELP biker man Excel Discussion (Misc queries) 1 July 28th 07 04:06 PM
end subroutine melric Excel Programming 3 March 31st 05 12:32 AM
Code won't run in a subroutine! Craig[_8_] Excel Programming 3 September 8th 04 04:47 AM
Every second subroutine dolegow Excel Programming 1 October 12th 03 02:11 AM


All times are GMT +1. The time now is 08:46 PM.

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

About Us

"It's about Microsoft Excel"