<?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: Fixing Links To UDFs in Addins</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/</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: Simon Murphy</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/#comment-32673</link>
		<dc:creator>Simon Murphy</dc:creator>
		<pubDate>Wed, 04 Jun 2008 01:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1848#comment-32673</guid>
		<description>&lt;p&gt;Rob&lt;br&gt;
I&#039;m with you on Excel .net support, and the VSTO guys are making good progress so I hope the story improves in O14. For UDFs don&#039;t discount XLM though it can be tons faster than VBA, especially for simple stuff (loops suck big time).&lt;/p&gt;
&lt;p&gt;By my estimate the effort to learn C and the Excel C API = the effort to learn .net and the deployment challenges.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Rob<br />
I&#8217;m with you on Excel .net support, and the VSTO guys are making good progress so I hope the story improves in O14. For UDFs don&#8217;t discount XLM though it can be tons faster than VBA, especially for simple stuff (loops suck big time).</p>
<p>By my estimate the effort to learn C and the Excel C API = the effort to learn .net and the deployment challenges.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Williams</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/#comment-32668</link>
		<dc:creator>Charles Williams</dc:creator>
		<pubDate>Tue, 03 Jun 2008 18:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1848#comment-32668</guid>
		<description>&lt;p&gt;The bug is that each execution of a UDF changes the VBE titlebar to say &quot;Running&quot; and then switches back, unless the calculation is initiated from VBA. The resultant VBE screen flicker and windows message flows can slow down recalc significantly.&lt;/p&gt;
&lt;p&gt;The problem is easily bypassed by using on-key to trap F9 etc, except in Automatic mode.  The bug is present in all versions of Excel from Excel 97 through Excel 2007. Microsoft are aware of and can reproduce the bug.&lt;/p&gt;
&lt;p&gt;The info is on the UDFs page on my website:&lt;br&gt;
&lt;a href=&quot;http://www.decisionModels.com/calcsecretsj.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.decisionModels.com/calcsecretsj.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Automatic and Function key Calculation slower than VBA calculation&lt;/p&gt;
&lt;p&gt;UDFs calculate significantly slower when the calculation is started automatically by Excel or by pressing F9 than when the calculation is started by a vba calculation statement like Application.calculate.&lt;br&gt;
The slowdown is significantly larger if the VBE is open and not minimised.&lt;br&gt;
The slowdown is an overhead for each UDF that is recalculated, so its roughly proportional to the number of UDFs.&lt;/p&gt;
&lt;p&gt;These timings are for 16000 very simple UDFs, using Excel 2002 on an AMD 1200MHZ with Windows XP:&lt;br&gt;
Autocalc with VBE open and maximised&lt;br&gt;
91 seconds&lt;br&gt;
Autocalc with VBE open and minimised&lt;br&gt;
38 seconds&lt;br&gt;
Autocalc with VBE closed&lt;br&gt;
2 seconds&lt;br&gt;
Application.Calculatefull with VBE open and maximised&lt;br&gt;
0.302 seconds&lt;br&gt;
Application.Calculatefull with VBE closed&lt;br&gt;
0.293 seconds&lt;/p&gt;
&lt;p&gt;So if you are using a lot of UDFs it really pays to be in manual calculation mode and have a calculate button that uses VBA to initiate an Excel calculation (Application.Calculate or Application.Calculatefull).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The bug is that each execution of a UDF changes the VBE titlebar to say &#8220;Running&#8221; and then switches back, unless the calculation is initiated from VBA. The resultant VBE screen flicker and windows message flows can slow down recalc significantly.</p>
<p>The problem is easily bypassed by using on-key to trap F9 etc, except in Automatic mode.  The bug is present in all versions of Excel from Excel 97 through Excel 2007. Microsoft are aware of and can reproduce the bug.</p>
<p>The info is on the UDFs page on my website:<br />
<a href="http://www.decisionModels.com/calcsecretsj.htm" rel="nofollow">http://www.decisionModels.com/calcsecretsj.htm</a></p>
<p>Automatic and Function key Calculation slower than VBA calculation</p>
<p>UDFs calculate significantly slower when the calculation is started automatically by Excel or by pressing F9 than when the calculation is started by a vba calculation statement like Application.calculate.<br />
The slowdown is significantly larger if the VBE is open and not minimised.<br />
The slowdown is an overhead for each UDF that is recalculated, so its roughly proportional to the number of UDFs.</p>
<p>These timings are for 16000 very simple UDFs, using Excel 2002 on an AMD 1200MHZ with Windows XP:<br />
Autocalc with VBE open and maximised<br />
91 seconds<br />
Autocalc with VBE open and minimised<br />
38 seconds<br />
Autocalc with VBE closed<br />
2 seconds<br />
Application.Calculatefull with VBE open and maximised<br />
0.302 seconds<br />
Application.Calculatefull with VBE closed<br />
0.293 seconds</p>
<p>So if you are using a lot of UDFs it really pays to be in manual calculation mode and have a calculate button that uses VBA to initiate an Excel calculation (Application.Calculate or Application.Calculatefull).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Glancy</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/#comment-32667</link>
		<dc:creator>Doug Glancy</dc:creator>
		<pubDate>Tue, 03 Jun 2008 18:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1848#comment-32667</guid>
		<description>&lt;p&gt;Charles, What&#039;s the &quot;VBE refresh slowdown bug?&quot;  I googled, including with your business name, but nothing leapt out at me.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Charles, What&#8217;s the &#8220;VBE refresh slowdown bug?&#8221;  I googled, including with your business name, but nothing leapt out at me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Williams</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/#comment-32663</link>
		<dc:creator>Charles Williams</dc:creator>
		<pubDate>Tue, 03 Jun 2008 11:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1848#comment-32663</guid>
		<description>&lt;p&gt;If you wanted a fully-supported .Net solution you could try Jens Thiel managed XLL. I have not used it myself but i hear good reports (It also bypasses the marshalling problem in favour of the C API).&lt;/p&gt;
&lt;p&gt;Technology timing comparison for one particular test UDF:&lt;br&gt;
VBA   1.5&lt;br&gt;
VB6   1.4&lt;br&gt;
c#    9.1&lt;br&gt;
c++   0.88&lt;/p&gt;
&lt;p&gt;As you can see the C# performance is truly appalling: this is supposed to be down to the marshalling layer.&lt;/p&gt;
&lt;p&gt;In many cases compiled VB6 does not run any faster than VBA, probably because most of the time is either spent in data transfer between Excel and VB or in the VB runtime.&lt;br&gt;
Even the most calculation-intensive UDF I have only showed a small (10-15%) improvement with a compiled VB6 automation addin.&lt;/p&gt;
&lt;p&gt;(the VBA timings all bypass the VBE refresh slowdown bug)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you wanted a fully-supported .Net solution you could try Jens Thiel managed XLL. I have not used it myself but i hear good reports (It also bypasses the marshalling problem in favour of the C API).</p>
<p>Technology timing comparison for one particular test UDF:<br />
VBA   1.5<br />
VB6   1.4<br />
c#    9.1<br />
c++   0.88</p>
<p>As you can see the C# performance is truly appalling: this is supposed to be down to the marshalling layer.</p>
<p>In many cases compiled VB6 does not run any faster than VBA, probably because most of the time is either spent in data transfer between Excel and VB or in the VB runtime.<br />
Even the most calculation-intensive UDF I have only showed a small (10-15%) improvement with a compiled VB6 automation addin.</p>
<p>(the VBA timings all bypass the VBE refresh slowdown bug)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/#comment-32659</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Tue, 03 Jun 2008 09:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1848#comment-32659</guid>
		<description>&lt;p&gt;I recently downloaded ExcelDNA, but that&#039;s as far as I got. Development appears stalled, and looks experimental... not really something I want to throw at my customers.&lt;br&gt;
To be honest, I just want Excel to support .NET libraries as add-ins out of the box. Oh, and I want a .NET flavoured RefEdit control.&lt;/p&gt;
&lt;p&gt;I wonder why automation add-ins with C# perform rubbish? I would have expected VB6 compiled to perform worse. I need to look into that, I think :)&lt;br&gt;
Cheers for the tip, I didn&#039;t click that VS.NET can do COM.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I recently downloaded ExcelDNA, but that&#8217;s as far as I got. Development appears stalled, and looks experimental&#8230; not really something I want to throw at my customers.<br />
To be honest, I just want Excel to support .NET libraries as add-ins out of the box. Oh, and I want a .NET flavoured RefEdit control.</p>
<p>I wonder why automation add-ins with C# perform rubbish? I would have expected VB6 compiled to perform worse. I need to look into that, I think <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />
Cheers for the tip, I didn&#8217;t click that VS.NET can do COM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Murphy</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/#comment-32658</link>
		<dc:creator>Simon Murphy</dc:creator>
		<pubDate>Tue, 03 Jun 2008 09:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1848#comment-32658</guid>
		<description>&lt;p&gt;Rob&lt;br&gt;
You can write automation add-ins with C# but the performance is rubbish. But there is an open source project called ExcelDNA that allows you to write C# UDFs, it passes them through the xll interface so they perform well.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Rob<br />
You can write automation add-ins with C# but the performance is rubbish. But there is an open source project called ExcelDNA that allows you to write C# UDFs, it passes them through the xll interface so they perform well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/06/02/fixing-links-to-udfs-in-addins/#comment-32655</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Tue, 03 Jun 2008 06:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1848#comment-32655</guid>
		<description>&lt;p&gt;The trouble is Excel tries to use relative paths wherever possible. I recall having problems with users creating workbooks (that relied on my addin) from their C: drive, and trying to publish them on the network drive.&lt;/p&gt;
&lt;p&gt;I also dabbled with VBA References to the XLA, which worked ok, but had similar problems with path locations.&lt;/p&gt;
&lt;p&gt;In the end, I settled on the COM automation add-in (a feature of Excel 2002 onward), because it did not track path locations.&lt;br&gt;
The only down side (and this is a minor issue, really!) is that you get funky looking dotted function names prior to the first successful calculations eg. =MyAddIn.MyFunction() before, and =MyFunction() after.&lt;br&gt;
This was an issue for me because I had a custom right-click context menu for breaking the formula into tokens for a formula builder screen. It was never an issue for the users.&lt;br&gt;
Automation Add-Ins are great.&lt;/p&gt;
&lt;p&gt;Ideally, I would have used XLL, but I don&#039;t have the programming experience with C++ to make it as rock solid as I required.&lt;br&gt;
I&#039;d love to write Excel UDFs in Visual Studio C#, but (I believe) only pay solutions exist so far, eg managedxll.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The trouble is Excel tries to use relative paths wherever possible. I recall having problems with users creating workbooks (that relied on my addin) from their C: drive, and trying to publish them on the network drive.</p>
<p>I also dabbled with VBA References to the XLA, which worked ok, but had similar problems with path locations.</p>
<p>In the end, I settled on the COM automation add-in (a feature of Excel 2002 onward), because it did not track path locations.<br />
The only down side (and this is a minor issue, really!) is that you get funky looking dotted function names prior to the first successful calculations eg. =MyAddIn.MyFunction() before, and =MyFunction() after.<br />
This was an issue for me because I had a custom right-click context menu for breaking the formula into tokens for a formula builder screen. It was never an issue for the users.<br />
Automation Add-Ins are great.</p>
<p>Ideally, I would have used XLL, but I don&#8217;t have the programming experience with C++ to make it as rock solid as I required.<br />
I&#8217;d love to write Excel UDFs in Visual Studio C#, but (I believe) only pay solutions exist so far, eg managedxll.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

