<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Multiple Add-ins</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2008/07/29/multiple-add-ins/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2008/07/29/multiple-add-ins/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/29/multiple-add-ins/#comment-33934</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Wed, 30 Jul 2008 16:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1872#comment-33934</guid>
		<description>&lt;p&gt;Dick,&lt;/p&gt;
&lt;p&gt;Like John said, it sounds very confusing.  Also, in every version of Excel where I have tried to have 2 add-ins communicate with each other, sooner or later I have got an error along the lines of &quot;the callee has disconnected and cannot be reached.&quot;&lt;/p&gt;
&lt;p&gt;My approach to multiple add-ins with overlapping menus is the following.  A table contains information about all the menus needed by a particular add-in.  This table can be an Excel range or an array.  The latter is used for Word and PowerPoint add-ins.&lt;/p&gt;
&lt;p&gt;I have designated one add-in as the &quot;master&quot; for code that is common across all my add-ins.  This code includes commandbar, help, version, registration and website handling.  If I have to make any changes to those routines, the changes always start with this one add-in.  The commandbar, i.e., menu, handler is all in one class module.  Each add-in&#039;s Open and BeforeClose event routines simply create an instance of the menu class and call the appropriate method (CreateMenus or DeleteMenus) with the appropriate argument(s).&lt;/p&gt;
&lt;p&gt;[I&#039;ve had to add two additional modules (one a form, the other a standard module) to get add-ins to play nice across the 2003-2007 divide.]&lt;/p&gt;
&lt;p&gt;CreateMenus goes through every row in the table passed to it as an argument.  Each row contains information about one menu item, including the menu hierarchy, which includes the following: Application commandbar name, (optional) name of the &#039;top level&#039; menu within the application commandbar, (optional) name of &#039;pop up&#039; submenu under the &#039;top level&#039; menu, and the menu item itself.&lt;/p&gt;
&lt;p&gt;The code adds any menus / submenus as needed until it can create the menu item itself.  By making the top level menu optional, the same code can create items in context menus (such as the Cell commandbar that is accessed by a right click on a cell).&lt;/p&gt;
&lt;p&gt;The DeleteMenus uses the same table as the CreateMenus routine to reverse the process.  It deletes the menu item.  Then, if the submenu has zero children, it deletes the submenu.  Then, if the &#039;top level&#039; menu has zero children it deletes it.&lt;/p&gt;
&lt;p&gt;Also, the menu handling code includes a mechanism whereby it creates menu items that work in an application add-in (using the OnAction property) or a COM add-in (event driven).&lt;/p&gt;
&lt;p&gt;To create different menu setups for different clients / environments requires just a change in the entries in the table in the respective add-ins.  No code changes needed.&lt;/p&gt;
&lt;p&gt;IMO, clean, self-contained, easy to maintain, and all add-ins play nice.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick,</p>
<p>Like John said, it sounds very confusing.  Also, in every version of Excel where I have tried to have 2 add-ins communicate with each other, sooner or later I have got an error along the lines of &#8220;the callee has disconnected and cannot be reached.&#8221;</p>
<p>My approach to multiple add-ins with overlapping menus is the following.  A table contains information about all the menus needed by a particular add-in.  This table can be an Excel range or an array.  The latter is used for Word and PowerPoint add-ins.</p>
<p>I have designated one add-in as the &#8220;master&#8221; for code that is common across all my add-ins.  This code includes commandbar, help, version, registration and website handling.  If I have to make any changes to those routines, the changes always start with this one add-in.  The commandbar, i.e., menu, handler is all in one class module.  Each add-in&#8217;s Open and BeforeClose event routines simply create an instance of the menu class and call the appropriate method (CreateMenus or DeleteMenus) with the appropriate argument(s).</p>
<p>[I've had to add two additional modules (one a form, the other a standard module) to get add-ins to play nice across the 2003-2007 divide.]</p>
<p>CreateMenus goes through every row in the table passed to it as an argument.  Each row contains information about one menu item, including the menu hierarchy, which includes the following: Application commandbar name, (optional) name of the &#8216;top level&#8217; menu within the application commandbar, (optional) name of &#8216;pop up&#8217; submenu under the &#8216;top level&#8217; menu, and the menu item itself.</p>
<p>The code adds any menus / submenus as needed until it can create the menu item itself.  By making the top level menu optional, the same code can create items in context menus (such as the Cell commandbar that is accessed by a right click on a cell).</p>
<p>The DeleteMenus uses the same table as the CreateMenus routine to reverse the process.  It deletes the menu item.  Then, if the submenu has zero children, it deletes the submenu.  Then, if the &#8216;top level&#8217; menu has zero children it deletes it.</p>
<p>Also, the menu handling code includes a mechanism whereby it creates menu items that work in an application add-in (using the OnAction property) or a COM add-in (event driven).</p>
<p>To create different menu setups for different clients / environments requires just a change in the entries in the table in the respective add-ins.  No code changes needed.</p>
<p>IMO, clean, self-contained, easy to maintain, and all add-ins play nice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Walkenbach</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/29/multiple-add-ins/#comment-33922</link>
		<dc:creator>John Walkenbach</dc:creator>
		<pubDate>Wed, 30 Jul 2008 03:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1872#comment-33922</guid>
		<description>&lt;p&gt;Sounds very confusing to me. Have you ever looked at the source code for my PUP add-in? It&#039;s one add-in that controls about 50 other add-ins. They are loaded as needed, and unloaded when subsequent ones are loaded.&lt;/p&gt;
&lt;p&gt;Let me know if you want the password.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Sounds very confusing to me. Have you ever looked at the source code for my PUP add-in? It&#8217;s one add-in that controls about 50 other add-ins. They are loaded as needed, and unloaded when subsequent ones are loaded.</p>
<p>Let me know if you want the password.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/07/29/multiple-add-ins/#comment-33916</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 29 Jul 2008 22:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1872#comment-33916</guid>
		<description>&lt;p&gt;&quot;One problem is code duplication.&quot;&lt;/p&gt;
&lt;p&gt;Keep all the related code in its own module. When you have to change it, do so in one add-in, then replace the module in the other add-ins with the modified module. Not perfect, but not too much of a bother.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8220;One problem is code duplication.&#8221;</p>
<p>Keep all the related code in its own module. When you have to change it, do so in one add-in, then replace the module in the other add-ins with the modified module. Not perfect, but not too much of a bother.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

