<?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: Using custom icons with an application-specific add-in in Excel 2007 Beta 2</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2006/08/18/using-custom-icons-with-an-application-specific-add-in-in-excel-2007-beta-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2006/08/18/using-custom-icons-with-an-application-specific-add-in-in-excel-2007-beta-2/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: John West</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/18/using-custom-icons-with-an-application-specific-add-in-in-excel-2007-beta-2/#comment-20784</link>
		<dc:creator>John West</dc:creator>
		<pubDate>Mon, 28 Aug 2006 21:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1482#comment-20784</guid>
		<description>&lt;p&gt;With respect to the getImage callback function declaration, this works for me using VB6:&lt;/p&gt;
&lt;p&gt;Public Function RibbonGetImage(Ctrl As IRibbonControl) &#039; As IPictureDisp&lt;/p&gt;
&lt;p&gt;Select Case Ctrl.id&lt;/p&gt;
&lt;p&gt;    Case &quot;adHelpGallery&quot;&lt;br&gt;
        Set RibbonGetImage = LoadResPicture(img_adHelpGallery, vbResBitmap)&lt;/p&gt;
&lt;p&gt;    Case &quot;adRowsMenu&quot;&lt;br&gt;
        Set RibbonGetImage = LoadResPicture(img_adRowsGallery, vbResBitmap)&lt;/p&gt;
&lt;p&gt;    Case &quot;adColumnsMenu&quot;&lt;br&gt;
        Set RibbonGetImage = LoadResPicture(img_adColumnsGallery, vbResBitmap)&lt;/p&gt;
&lt;p&gt;    Case &quot;adCellsMenu&quot;&lt;br&gt;
        Set RibbonGetImage = LoadResPicture(img_adCellsGallery, vbResBitmap)&lt;br&gt;
    ...&lt;/p&gt;
&lt;p&gt;End Select&lt;/p&gt;
&lt;p&gt;End Function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>With respect to the getImage callback function declaration, this works for me using VB6:</p>
<p>Public Function RibbonGetImage(Ctrl As IRibbonControl) &#8216; As IPictureDisp</p>
<p>Select Case Ctrl.id</p>
<p>    Case &#8220;adHelpGallery&#8221;<br />
        Set RibbonGetImage = LoadResPicture(img_adHelpGallery, vbResBitmap)</p>
<p>    Case &#8220;adRowsMenu&#8221;<br />
        Set RibbonGetImage = LoadResPicture(img_adRowsGallery, vbResBitmap)</p>
<p>    Case &#8220;adColumnsMenu&#8221;<br />
        Set RibbonGetImage = LoadResPicture(img_adColumnsGallery, vbResBitmap)</p>
<p>    Case &#8220;adCellsMenu&#8221;<br />
        Set RibbonGetImage = LoadResPicture(img_adCellsGallery, vbResBitmap)<br />
    &#8230;</p>
<p>End Select</p>
<p>End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/18/using-custom-icons-with-an-application-specific-add-in-in-excel-2007-beta-2/#comment-20724</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Wed, 23 Aug 2006 23:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1482#comment-20724</guid>
		<description>&lt;p&gt;Mike (Rosenblum):&lt;br&gt;
About the strong-type argument to the getImage callback: I should withdraw that statement.  At the time I submitted the bug report and wrote my writeup, the problem happened consistently.  But, Microsoft couldn&#039;t reproduce it and when I went back to check it out, it no longer happened.  The big difference between the two instances was that I had rebooted the machine.  So, I imagine the problem may resurface or affect someone else, but it is not reproducible at will.&lt;/p&gt;
&lt;p&gt;I have thought of writing an &quot;add-in manager&quot; to manage all the add-ins but I hope it doesn&#039;t come to that.  It would be very clunky and kind of defeats the purpose of having RibbonX act as the &quot;add-in manager.&quot; &lt;/p&gt;
&lt;p&gt;Michael (Scherotter): In one of the many moments of sheer frustration at not getting the images to work (this was before I figured out that one should exclude the file extension) I tried something akin to what you suggest.  I didn&#039;t expect it to work.  And, it didn&#039;t.  The only way for it to actually work would be to have the OS (or however LoadPicture is implemented) be knowledgable about the 2007 file format and be willing to extract the indicated file from within the zip file.  Of course, it is not rocket science and should be eminently doable since the newer versions of Windows already work with zip files at a basic level.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Mike (Rosenblum):<br />
About the strong-type argument to the getImage callback: I should withdraw that statement.  At the time I submitted the bug report and wrote my writeup, the problem happened consistently.  But, Microsoft couldn&#8217;t reproduce it and when I went back to check it out, it no longer happened.  The big difference between the two instances was that I had rebooted the machine.  So, I imagine the problem may resurface or affect someone else, but it is not reproducible at will.</p>
<p>I have thought of writing an &#8220;add-in manager&#8221; to manage all the add-ins but I hope it doesn&#8217;t come to that.  It would be very clunky and kind of defeats the purpose of having RibbonX act as the &#8220;add-in manager.&#8221; </p>
<p>Michael (Scherotter): In one of the many moments of sheer frustration at not getting the images to work (this was before I figured out that one should exclude the file extension) I tried something akin to what you suggest.  I didn&#8217;t expect it to work.  And, it didn&#8217;t.  The only way for it to actually work would be to have the OS (or however LoadPicture is implemented) be knowledgable about the 2007 file format and be willing to extract the indicated file from within the zip file.  Of course, it is not rocket science and should be eminently doable since the newer versions of Windows already work with zip files at a basic level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael S. Scherotter</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/18/using-custom-icons-with-an-application-specific-add-in-in-excel-2007-beta-2/#comment-20711</link>
		<dc:creator>Michael S. Scherotter</dc:creator>
		<pubDate>Tue, 22 Aug 2006 20:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1482#comment-20711</guid>
		<description>&lt;p&gt;Do you know if there is any way to load an image from the CustomUIimages section of the file for the getImage callback?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br&gt;
Michael&lt;/p&gt;
&lt;p&gt;The following does not work:&lt;/p&gt;
&lt;p&gt;Public Sub GetIcon(control As IRibbonControl, ByRef image)&lt;/p&gt;
&lt;p&gt;    On Error Resume Next&lt;/p&gt;
&lt;p&gt;    Dim filename As String&lt;/p&gt;
&lt;p&gt;    filename = ActiveDocument.FullName &amp; &quot;customUIimagesIcon_SmileyHappy.png&quot;&lt;/p&gt;
&lt;p&gt;    Debug.Print &quot;Loading picture &quot; + filename + &quot;...&quot;&lt;/p&gt;
&lt;p&gt;    Dim picture As IPictureDisp&lt;/p&gt;
&lt;p&gt;    Set picture = LoadPicture(filename, 16, 16, Default)&lt;/p&gt;
&lt;p&gt;    Set image = picture&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Do you know if there is any way to load an image from the CustomUIimages section of the file for the getImage callback?</p>
<p>Thanks,<br />
Michael</p>
<p>The following does not work:</p>
<p>Public Sub GetIcon(control As IRibbonControl, ByRef image)</p>
<p>    On Error Resume Next</p>
<p>    Dim filename As String</p>
<p>    filename = ActiveDocument.FullName &amp; &#8220;customUIimagesIcon_SmileyHappy.png&#8221;</p>
<p>    Debug.Print &#8220;Loading picture &#8221; + filename + &#8220;&#8230;&#8221;</p>
<p>    Dim picture As IPictureDisp</p>
<p>    Set picture = LoadPicture(filename, 16, 16, Default)</p>
<p>    Set image = picture</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Rosenblum</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/18/using-custom-icons-with-an-application-specific-add-in-in-excel-2007-beta-2/#comment-20667</link>
		<dc:creator>Mike Rosenblum</dc:creator>
		<pubDate>Sun, 20 Aug 2006 18:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1482#comment-20667</guid>
		<description>&lt;p&gt;Hey Tushar,&lt;/p&gt;
&lt;p&gt;Both of these articles are really excellent.  It looks like other than a few strong-typing issues and slight bugs that it seems to work &quot;as advertized&quot;, eh?&lt;/p&gt;
&lt;p&gt;You made a comment here in the 1st of your two articles about making use of the IRibbonExtensibility interface:&lt;/p&gt;
&lt;p&gt;&gt; &quot;from what I can tell, the many dynamic changes in the RibbonX interface are not available to VBA (those that need the IRibbonExtensibility interface).&quot;&lt;/p&gt;
&lt;p&gt;I&#039;m not sure, however, that one would actually need to use IRibbonExtensibility in VBA because the XML is embedded within the XLSM or XLAM document itself. In the case where one&#039;s add-in really does need to respond dynamically at startup, then I would think that setting various controls&#039;, groups&#039;, and/or tabs&#039; enabled or visible states would do the trick. &lt;/p&gt;
&lt;p&gt;Of course, if one had VB6 or MOD then a COM Add-in could be made, implementing IRibbonExtensibility. However, if using VBA-only, and we really wanted to push the Ribbon XML dynamism at startup, then I guess one could create a startup &quot;loader VBA&quot; add-in which would dynamically choose to open the correct subordinate VBA Add-in as required at run-time. The &quot;subordinate VBA Add-in&quot; would contain the correct XML string. This is clunkier than being able to dynamically return a string, but it should be effectively pretty close.&lt;/p&gt;
&lt;p&gt;Thanks for an excellent read, really nice job...&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Tushar,</p>
<p>Both of these articles are really excellent.  It looks like other than a few strong-typing issues and slight bugs that it seems to work &#8220;as advertized&#8221;, eh?</p>
<p>You made a comment here in the 1st of your two articles about making use of the IRibbonExtensibility interface:</p>
<p>&gt; &#8220;from what I can tell, the many dynamic changes in the RibbonX interface are not available to VBA (those that need the IRibbonExtensibility interface).&#8221;</p>
<p>I&#8217;m not sure, however, that one would actually need to use IRibbonExtensibility in VBA because the XML is embedded within the XLSM or XLAM document itself. In the case where one&#8217;s add-in really does need to respond dynamically at startup, then I would think that setting various controls&#8217;, groups&#8217;, and/or tabs&#8217; enabled or visible states would do the trick. </p>
<p>Of course, if one had VB6 or MOD then a COM Add-in could be made, implementing IRibbonExtensibility. However, if using VBA-only, and we really wanted to push the Ribbon XML dynamism at startup, then I guess one could create a startup &#8220;loader VBA&#8221; add-in which would dynamically choose to open the correct subordinate VBA Add-in as required at run-time. The &#8220;subordinate VBA Add-in&#8221; would contain the correct XML string. This is clunkier than being able to dynamically return a string, but it should be effectively pretty close.</p>
<p>Thanks for an excellent read, really nice job&#8230;</p>
<p>Mike</p>
]]></content:encoded>
	</item>
</channel>
</rss>

