How to call module function or sub from the Add In?

A

Archidamos

Hi all,
I have an Add In which is used by many worksheets.
In every worksheet module there is the starting sub 'Start'.
I created the icon in the Quick Access Toolbar and connected it to the macro located in Add In. From this macro I want to run the sub Start, which is in module belonging to currently opened worksheet.
In summary, the point is to use one icon to run the macro 'Start' in different worksheets.
But it's not working. Excel says 'Sub of Function not defined'.
It's there any way to run module macro from an Add In?
Thanks in advance.

Archidamos
 
C

Claus Busch

Hi,

Am Fri, 21 Feb 2014 06:35:40 -0800 (PST) schrieb Archidamos:
I have an Add In which is used by many worksheets.
In every worksheet module there is the starting sub 'Start'.
I created the icon in the Quick Access Toolbar and connected it to the macro located in Add In. From this macro I want to run the sub Start, which is in module belonging to currently opened worksheet.
In summary, the point is to use one icon to run the macro 'Start' in different worksheets.

if you run a macro from a different workbook you have to write the
workbook name and the macro name like this:
Application.Run ("'" & ActiveWorkbook.Name & "'!Start")


Regards
Claus B.
 
A

Archidamos

W dniu pi±tek, 21 lutego 2014 15:59:04 UTC+1 u¿ytkownik Claus Busch napisa³:
Application.Run ("'" & ActiveWorkbook.Name & "'!Start")

Thank you very much Claus!

Regards
Archidamos
 
G

GS

Typically, addins create their own menus/toolbars at startup and remove
them at shutdown. This is particularly the case when the addin's
procedures are to be used with other workbooks.

In early versions of Excel addin menus are placed on the default
menubars and/or use their own toolbar. In 2007 and later these will
appear on the 'Addins' tab of the Ribbon.

So there's no need to use the QAT, and there's never a question as to
whether the macros associated with custom menus are available since
they're created when the addin opens and removed before it closes.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top