Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to call module function or sub from the Add In?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default How to call module function or sub from the Add In?

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.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to call module function or sub from the Add In?

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default How to call module function or sub from the Add In?

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


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
Module call RJH Excel Programming 4 September 7th 06 06:04 AM
Call other sub in the same module yangyh[_4_] Excel Programming 1 September 11th 05 09:24 AM
how to call Access's function in different module in Excel VBA miao jie Excel Programming 0 July 25th 04 04:03 AM
how to call Access function&module in Excel VBA?? miao jie Excel Programming 1 July 24th 04 04:49 PM
Call Private Function from ThisWorkbook module Beto[_3_] Excel Programming 3 February 25th 04 01:36 PM


All times are GMT +1. The time now is 03:11 AM.

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"