<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Grumpy Old Programmer</title>
	<atom:link href="http://grumpyop.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://grumpyop.wordpress.com</link>
	<description>He's old, he's a programmer and he's grumpy</description>
	<lastBuildDate>Wed, 25 Nov 2009 21:59:15 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='grumpyop.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/22278fa7af46e02ac9735a826f95dbc3?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Grumpy Old Programmer</title>
		<link>http://grumpyop.wordpress.com</link>
	</image>
			<item>
		<title>A Third Way: DNA?</title>
		<link>http://grumpyop.wordpress.com/2009/11/25/a-third-way-dna/</link>
		<comments>http://grumpyop.wordpress.com/2009/11/25/a-third-way-dna/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 21:59:15 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[dotNET]]></category>
		<category><![CDATA[xll]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=400</guid>
		<description><![CDATA[(stackoverflow rep: 8417, Project Euler 87/261 complete
When we want Excel to talk to a compiled library, the list of options available to us is not long.
On the one hand, we can write a compiled library that references the Excel SDK (pre- or post-2007), setting its prefix to XLL for convenience, typically we&#8217;d grit our collective [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=400&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h6 style="text-align:right;"><a href="http://stackoverflow.com">(stackoverflow</a> rep: 8417, <a href="http://projecteuler.net">Project Euler</a> 87/261 complete</h6>
<p>When we want Excel to talk to a compiled library, the list of options available to us is not long.</p>
<p>On the one hand, we can write a compiled library that references the Excel SDK (<a href="http://www.microsoft.com/downloads/details.aspx?familyid=c6189658-d915-4140-908a-9a0114953721&amp;displaylang=en">pre</a>- or <a href="http://msdn.microsoft.com/en-us/library/bb687827.aspx">post-2007</a>), setting its prefix to <a href="http://msdn.microsoft.com/en-us/library/bb687911.aspx">XLL</a> for convenience, typically we&#8217;d grit our collective teeth and accomplish this with C or (<em>cough, spit</em>) C++. One big plus here is speed &#8211; we&#8217;re talking to Excel in its own language. Or something awfully close to it. Another plus, of course, is that this approach probably involves the minimum set of dependencies for non-enterprise distribution convenience. If you haven&#8217;t spotted the big minus then we should probably agree to disagree on the relative merits of programming languages.</p>
<p>On the other hand, we can write a library that exposes its functions through good ol&#8217; <a href="http://en.wikipedia.org/wiki/Component_Object_Model">COM</a>, referencing it though the Tool&#8230;Add-ins dialog. That&#8217;s probably still the best-known way to integrate functionality developed in .NET, although it does involve paying a performance price as the COM interface is crossed and recrossed. This would be the place in the world most usually occupied by <a href="http://msdn.microsoft.com/en-gb/office/dd253199.aspx">VSTO</a>. Of course, you could also write your COM library in non-managed code: VB6 is easy (if you can find it) but slow, the choice from others depends on your capacity (or desire) for pain.</p>
<p>On <a href="http://en.wikipedia.org/wiki/On_the_gripping_hand_%28idiom%29">the gripping hand</a>, we have <a href="http://groups.google.com/group/exceldna/web/getting-started-with-exceldna">ExcelDNA</a>, which for my money is one of the all-round <a href="http://www.entertonement.com/clips/bcljjrgbqb--It%27s-so-cunning-you-could-brush-your-teeth-with-itBlack-Adder-Rowan-Atkinson-The-Blackadder-Prince-Edmund-Duke-of-Edinburgh-">cunningest</a> things you&#8217;re likely to come across in quite a long time. (Unless you&#8217;ve already encountered its cunningness, of course, in which case you&#8217;re probably already nodding along in sage agreement). How so? How about being able to write your spiffy new functions in C# but without having to incur the needless ins and outs of the wasteful and superfluous COM middleman?</p>
<p>ExcelDNA provides a small XLL that can talk to managed code. There&#8217;s one attribute to set in order to make a function visible to Excel and one libary to import (in order to be able to add the attribute). Oh, and a little config file to tell the XLL what to load. That&#8217;s it. Actually, that&#8217;s the complicated version. In case you didn&#8217;t know, the <a href="http://en.wikipedia.org/wiki/Common_Language_Runtime">CLR</a> includes a compiler, allowing code to be created and compiled at run-time. The simplest way to talk to Excel from .NET via ExcelDNA is just to put your code directly into that little config file and let the XLL compile it at load time. OK, there&#8217;s a second or so&#8217;s overhead, but how simple &#8211; anything simpler would probably have to be involve <a href="http://grumpyop.wordpress.com/2008/09/28/whither-wither-vba/">21st-Century language integration</a> where VBA lives today.</p>
<p>By now you&#8217;re probably muttering something like &#8220;write code, fat bloke&#8221;, which is a little cruel, but a sentiment otherwise understandable. Now only the other day, Dick Kusleika posted <a href="http://www.dailydoseofexcel.com/archives/2009/11/10/joinrange/">his take</a> on the everybody-has-one timeless RangeJoin() UDF topic. Here&#8217;s a rather simpler implementation:</p>
<pre class="brush: csharp;">

&lt;DnaLibrary Language=&quot;CS&quot;&gt;
&lt;![CDATA[
using ExcelDna.Integration;
using System.Collections.Generic;

    public class MyFunctions
    {
        [ExcelFunction(Description=&quot;Joins cell values&quot;, Category=&quot;My ExcelDNA functions&quot;)]
        public static object RangeJoin(object[,] cells)
        {
            List&lt;string&gt; list = new List&lt;string&gt;();

            foreach (object o in cells)
                list.Add(o.ToString());

            return string.Join(&quot;,&quot;, list.ToArray());
        }
    }
]]&gt;
&lt;/DnaLibrary&gt;
</pre>
<p>To get it running, I saved it as &#8220;RangeJoin.dna&#8221;, then copied the ExcelDNA.xll into the same folder and renamed that to &#8220;RangeJoin.xll&#8221;. Because it isn&#8217;t currently anywhere on my path, I also put ExcelDna.Integration.dll in the folder. Then I double-clicked my new XLL file to start Excel and load the library. (Pictures below are from Excel 2002, but the code is tested up to 2007).</p>
<div id="attachment_411" class="wp-caption alignnone" style="width: 406px"><a href="http://grumpyop.files.wordpress.com/2009/11/excel_macro_warn.png"><img class="size-full wp-image-411" title="excel_macro_warn" src="http://grumpyop.files.wordpress.com/2009/11/excel_macro_warn.png?w=396&#038;h=193" alt="" width="396" height="193" /></a><p class="wp-caption-text">Not surprising...</p></div>
<p>There&#8217;s a tiny extra delay before the usual macro warning appears &#8211; the C# code&#8217;s being compiled, which is where compile-time failures are displayed. Then you&#8217;re up and running. The function shows up in the Insert Function dialog&#8230;</p>
<p><a href="http://grumpyop.files.wordpress.com/2009/11/insert_function.png"><img class="alignnone size-full wp-image-412" title="insert_function" src="http://grumpyop.files.wordpress.com/2009/11/insert_function.png?w=399&#038;h=275" alt="" width="399" height="275" /></a></p>
<p>&#8230; and we can try calling it:</p>
<p><a href="http://grumpyop.files.wordpress.com/2009/11/about_to_join.png"><img class="alignnone size-full wp-image-413" title="about_to_join" src="http://grumpyop.files.wordpress.com/2009/11/about_to_join.png?w=331&#038;h=96" alt="" width="331" height="96" /></a></p>
<p>&#8230; with the following result:</p>
<p><a href="http://grumpyop.files.wordpress.com/2009/11/joined.png"><img class="alignnone size-full wp-image-414" title="joined" src="http://grumpyop.files.wordpress.com/2009/11/joined.png?w=519&#038;h=72" alt="" width="519" height="72" /></a></p>
<p>I did notice the the =NA() output and the Euro amount came out different to what I&#8217;d have hoped. It rather looks like I&#8217;d have to dig a little deeper into the ExcelDna.Integration.dll and the ExcelReference object in particular in order to be able to access the equivalent of VBA&#8217;s Text property.</p>
<p>Still, not bad for a quick exercise, I&#8217;d say.</p>
<p>There are some alternative approaches to the dot-net-and-excel-without-going-anywhere-near-COM-add-ins topic:</p>
<h3>For Free</h3>
<p><a href="http://www.excel4net.com/">Excel4Net</a> is now free &#8211; it seems to work by implementing a single worksheet function that calls out to managed code;</p>
<p>The last time I looked at <a href="http://xlw.sourceforge.net/">XLW</a> it was focused on C++. That&#8217;s changed in the interim &#8211; C# and VB.NET are now options.</p>
<h3>Possibly Paid-for Propositions</h3>
<p><a href="http://www.lenholgate.com/">Len Holgate</a> appears to be at beta test stage with <a href="http://www.jetxll.net/">JetXLL</a>, which looks like it&#8217;ll be a commercial offering;</p>
<p>I also just discovered <a href="http://em-risk.com/groups/exhale/default.aspx">ExHale</a>. In beta, appears current &#8211; can&#8217;t see what the terms are likely to be;</p>
<h3>Definitely Demanding Dollars</h3>
<p>Possibly the first implementation, <a href="http://www.stochastix.de/solutions/excel/managedxll/latest/">ManagedXLL</a> is (was?) a paid-for product that looks to have been similar to, but possibly broader in scope than ExcelDNA. It&#8217;s not clear whether the company is still active or the product is still available &#8211; a curious colleague recently tried to make enquiries and failed.</p>
<p><img style="display:none;background-image:url('http://e0.extreme-dm.com/s9.g?login=quickgal&amp;j=y&amp;jv=n');" src="http://grumpyop.files.wordpress.com/2009/11/excel_macro_warn.png" alt="" /><img style="display:none;background-image:url('http://e0.extreme-dm.com/s9.g?login=quickgal&amp;j=y&amp;jv=n');" src="http://grumpyop.files.wordpress.com/2009/11/insert_function.png" alt="" /><img style="display:none;background-image:url('http://e0.extreme-dm.com/s9.g?login=quickgal&amp;j=y&amp;jv=n');" src="http://grumpyop.files.wordpress.com/2009/11/about_to_join.png" alt="" /><img style="display:none;background-image:url('http://e0.extreme-dm.com/s9.g?login=quickgal&amp;j=y&amp;jv=n');" src="http://grumpyop.files.wordpress.com/2009/11/joined.png" alt="" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/400/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=400&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/11/25/a-third-way-dna/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/excel_macro_warn.png" medium="image">
			<media:title type="html">excel_macro_warn</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/insert_function.png" medium="image">
			<media:title type="html">insert_function</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/about_to_join.png" medium="image">
			<media:title type="html">about_to_join</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/joined.png" medium="image">
			<media:title type="html">joined</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/excel_macro_warn.png" medium="image" />

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/insert_function.png" medium="image" />

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/about_to_join.png" medium="image" />

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/joined.png" medium="image" />
	</item>
		<item>
		<title>What Time Is It? Bah.</title>
		<link>http://grumpyop.wordpress.com/2009/11/10/what-time-is-it-bah/</link>
		<comments>http://grumpyop.wordpress.com/2009/11/10/what-time-is-it-bah/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 12:11:19 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[lotusnotes]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=389</guid>
		<description><![CDATA[It&#8217;s a long time since I last wrote about Lotus Notes and the unlimited joy that is its, er, idiosyncratic interface, not least since IBM&#8217;s decision1 to host the client in Eclipse.
Too long, really &#8211; it&#8217;s such a rich source of oddness. For example, today I recevied an invitation to join some colleagues (located in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=389&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s a long time since I <a href="http://grumpyop.wordpress.com/2008/09/23/programming-for-programmer-convenience/">last</a> wrote about <a href="http://www-01.ibm.com/software/lotus/products/notes/">Lotus Notes</a> and the unlimited joy that is its, er, <em>idiosyncratic</em> interface, not least since IBM&#8217;s decision<sup>1</sup> to <a href="http://www.ibm.com/developerworks/lotus/library/notes8-new/#N10065">host the client</a> in <a href="http://www.eclipse.org/">Eclipse</a>.</p>
<p>Too long, really &#8211; it&#8217;s such a rich source of oddness. For example, today I recevied an invitation to join some colleagues (located in Frankfurt) in a video conference. The heading in the message informed me that:</p>
<p><img class="alignnone size-full wp-image-393" title="NotesMeetingTime1" src="http://grumpyop.files.wordpress.com/2009/11/notesmeetingtime1.png?w=537&#038;h=30" alt="NotesMeetingTime1" width="537" height="30" /></p>
<p>Which seemed a little odd, since a quick phone call earlier had seen some time on Wednesday morning identified as the preferred time. No matter, I opened the message to accept the invitation (it&#8217;s not clear why I couldn&#8217;t do that from the inbox/preview, but I can&#8217;t). Clicking &#8220;Accept&#8221; put the meeting into my calendar:</p>
<p><img class="alignnone size-full wp-image-394" title="BookedMeeting" src="http://grumpyop.files.wordpress.com/2009/11/bookedmeeting.png?w=195&#038;h=70" alt="BookedMeeting" width="195" height="70" /></p>
<p>Whoops! Well, it was more in keeping with what I expected. To settle myself, I went for a coffee (you can tell Christmas is coming, btw: Starbucks are using the <a href="http://starbucks.co.uk/en-GB/_Our+Stores/Christmas+at+Starbucks.htm">Red Cups</a>). When I got back, Notes had been busy &#8211; the Inbox message now had this:</p>
<p><img class="alignnone size-full wp-image-395" title="NotesMeetingTime2" src="http://grumpyop.files.wordpress.com/2009/11/notesmeetingtime2.png?w=523&#038;h=26" alt="NotesMeetingTime2" width="523" height="26" /></p>
<p>OK, it&#8217;s now accurate, but I&#8217;m not sure how I feel about a message being modified in any way after I&#8217;ve <em>opened and read it</em>.</p>
<p>Of course, we&#8217;re 0.5 of a release behind the current version, so maybe stuff like this has been fixed by now.</p>
<p>&nbsp;</p>
<hr /><img class="alignright size-full wp-image-390" title="celebration" src="http://grumpyop.files.wordpress.com/2009/11/celebration.png?w=191&#038;h=210" alt="celebration" width="191" height="210" /></p>
<p>&nbsp;</p>
<p>The BBC <a href="http://news.bbc.co.uk/1/hi/health/8339647.stm">reports</a> that, in an <a href="http://www.australasianscience.com.au/">Australian Science magazine</a> article, an Australian psychology expert &#8220;who has been studying emotions has found being grumpy makes us think more clearly&#8221;.</p>
<p>&nbsp;</p>
<p>To which I can only say &#8220;hmph&#8221;.</p>
<p>&nbsp;</p>
<hr />
<sup>1</sup> I&#8217;d love to have been a fly on the wall at <em>that </em>meeting.</p>
<p>&nbsp;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/389/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/389/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/389/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=389&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/11/10/what-time-is-it-bah/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/notesmeetingtime1.png" medium="image">
			<media:title type="html">NotesMeetingTime1</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/bookedmeeting.png" medium="image">
			<media:title type="html">BookedMeeting</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/notesmeetingtime2.png" medium="image">
			<media:title type="html">NotesMeetingTime2</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/11/celebration.png" medium="image">
			<media:title type="html">celebration</media:title>
		</media:content>
	</item>
		<item>
		<title>Taming The Beast</title>
		<link>http://grumpyop.wordpress.com/2009/10/30/taming-the-beast/</link>
		<comments>http://grumpyop.wordpress.com/2009/10/30/taming-the-beast/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 17:17:10 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=346</guid>
		<description><![CDATA[(stackoverflow rep: 7963, Project Euler 83/261 complete &#8211; slacker!)
It&#8217;s a little while back now (I&#8217;m a slow thinker) but Simon Murphy, developing on a topic found in a post by Dick Moffat, discussed some observations of Excel usage within organisations. He concluded that general user skill levels are largely unchanged but that the uses to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=346&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h6 style="text-align:right;"><a href="http://stackoverflow.com">(stackoverflow</a> rep: 7963, <a href="http://projecteuler.net">Project Euler</a> 83/261 complete &#8211; slacker!)</h6>
<p>It&#8217;s a little while back now (I&#8217;m a slow thinker) but <a href="http://smurfonspreadsheets.wordpress.com/2009/09/01/skill-level/">Simon Murphy</a>, developing on a topic found in <a href="http://blogs.officezealot.com/dmoffat/archive/2008/04/15/a-dying-breed.aspx">a post by Dick Moffat</a>, discussed some observations of Excel usage within organisations. He concluded that general user skill levels are largely unchanged but that the uses to which Excel is being put are becoming more complex and at the same time training quality is declining. As a result, it&#8217;s increasingly commonplace that such organisations are seeking to reduce or limit the degree to which user-written spreadsheets are used.</p>
<div id="attachment_351" class="wp-caption alignright" style="width: 331px"><img class="size-full wp-image-351" title="visicalc" src="http://grumpyop.files.wordpress.com/2009/09/visicalc.png?w=321&#038;h=233" alt="The way the future was" width="321" height="233" /><p class="wp-caption-text">The way the future was</p></div>
<p>It&#8217;s a tricky one. We have this enabling technology that makes it possible for end-users to manipulate information in ways unheard-of before 1979 (the year <a href="http://www.bricklin.com/visicalc.htm">Visicalc</a> was launched). Since the introduction of the computer spreadsheet, the power and complexity (yes, ease of use too, but see below) of the products available has increased steadily, necessarily, if you think about it: if <a href="http://en.wikipedia.org/wiki/Multiplan">Multiplan</a>, <a href="http://www-01.ibm.com/software/lotus/products/123/">Lotus 1-2-3</a>, <a href="http://www.corel.com/servlet/Satellite/us/en/Product/1207676528492#tabview=tab1">Quattro Pro</a>, <a href="http://en.wikipedia.org/wiki/Informix_Wingz">Wingz</a>, Excel et al didn&#8217;t offer something more then we&#8217;d still be using Visicalc.</p>
<p>Putting a spreadsheet program on every desk-top computer, as is commonplace nowadays, due to Microsoft&#8217;s bundling policy: most will need Word and Outlook, they&#8217;ll probably expect <a href="http://www.edwardtufte.com/tufte/powerpoint">Powerpoint</a>, God help us, so Excel is almost certainly going to come along for the ride. Once it&#8217;s there, all but the most dedicated non-fiddlers will find it, even if it&#8217;s only because they&#8217;re drawn in by their peers.</p>
<p>I&#8217;d say a not-untypical progression starts with using the electronic squared paper to make lists or tables, moving on to the occasional diagram and then one day there&#8217;s the discovery of arithmetic, at which point Pandora (which wouldn&#8217;t be a bad name for a spreadsheet program) has opened the box and we&#8217;re heading downhill on a slippery slope into the land of overused metaphors, not to mention end-user spreadsheets.</p>
<p>There, I&#8217;ve said it: &#8220;end-user spreadsheets&#8221;. Three words (or two, depending on how you count hyphens) to strike fear into the giblets of any spreadsheet professional. Why? Here&#8217;s a selection of risks to which an organisation may be exposed:</p>
<ul>
<li>the spreadsheet uses the wrong function(s): anyone know the difference between STDEV() and STDEVP(), for example? Which should you use and when? What happens when the wrong one is still not accurate enough? What other areas might be dangerous? How about the entire &#8220;Financial&#8221; category?</li>
<li>dynamically-growing data ranges and fixed-size references: not all data is included in calculations</li>
<li>the user spends more time playing with his spreadsheet creation than he<sup>1</sup> should &#8211; losing focus on the job for which s/he is actually being paid</li>
<li>the spreadsheet becomes so useful that users other than the creator start to use it: the creator is now part of application support. Was that what you had in mind?</li>
<li>because protecting spreadsheets can be tricky, and changing cell contents to perform &#8220;what-if&#8221; calculations is easy, formulae may be overwritten with new un-noticed and un-wanted constants.</li>
<li>the spreadsheet acquires a noxious sludge of user-written VBA (<em>shudder</em>). You know, pages of global variables, no classes, 1500-line Subs, that sort of joy.</li>
</ul>
<p>That&#8217;s the 5-minute, off-the-top-of-my-head list. This is the sort of stuff that has IT people waking up screaming in the middle of the night and contract support people (been there, done that) reassured of continuing employment for the remainder of their working lives.</p>
<p>How to address the problem without flushing both baby and bathwater?<img class="alignright size-full wp-image-379" title="plughole" src="http://grumpyop.files.wordpress.com/2009/10/plughole.png?w=238&#038;h=203" alt="plughole" width="238" height="203" /></p>
<p>First of all, if no-one is prepared to accept that there may be some real risk here, then then whole question is moot and you&#8217;ve already irrevocably lost a few minutes of your life getting this far. Sorry about that.</p>
<p>A review process needs to be put in place: what XLS files are being stored on the network? Can you see who is referencing them? Reading or writing? Are there patterns that might indicate that any of the problems above are being experienced?</p>
<p>Can you write a &#8220;spider&#8221; that looks around the user spreadsheet &#8220;<a href="http://uk.encarta.msn.com/dictionary_1861772422/corpus.html">corpus</a>&#8220;  for frequent updates, evidence of VBA, all-round horribleness? Remember you&#8217;re not spying, you&#8217;re auditing.</p>
<p>As candidate files are identified, review them with the relevant user representatives to determine if the workbook is an signal for action to be taken. Such actions may include</p>
<ul>
<li>doing nothing &#8211; proactively chossing to do nothing is a perfectly reasonable option;</li>
<li>adding the workbook to the portfolio of maintained and supported spreadsheet applications;</li>
<li>setting up a project to address the business need in a more rigorous way;</li>
<li>a bit of <a href="http://en.wikipedia.org/wiki/Business_process_reengineering">business process re-engineering</a> to address any procedural deficiency that may have driven the need a an ad hoc spreadsheet.</li>
</ul>
<p>Again, that&#8217;s the five-minute list. What other courses of action might one take to mitigate the risks of the enthusiastic amateur running wild with a spreadsheet program in one&#8217;s business?</p>
<p>&nbsp;</p>
<hr /><sup>1</sup> Let&#8217;s face it, folks, it&#8217;s usually a &#8220;he&#8221;</p>
<p>&nbsp;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=346&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/10/30/taming-the-beast/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/09/visicalc.png" medium="image">
			<media:title type="html">visicalc</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/10/plughole.png" medium="image">
			<media:title type="html">plughole</media:title>
		</media:content>
	</item>
		<item>
		<title>Shippity-doo-dah</title>
		<link>http://grumpyop.wordpress.com/2009/09/29/shippity-doo-dah/</link>
		<comments>http://grumpyop.wordpress.com/2009/09/29/shippity-doo-dah/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 18:18:51 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Ancient History]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[War Stories]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=364</guid>
		<description><![CDATA[(stackoverflow rep: 7576, Project Euler 83/257 complete)
Reading Joel&#8217;s1 Duct-Tape Programmer article this morning (in the interests of full disclosure I should admit without additional prevarication that I have a large roll of &#8220;Duck&#8221; tape in the second drawer of my desk as I type) one sentence smacked me metaphorically between the eyes:
&#8220;Shipping is a feature&#8221;
I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=364&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h6 style="text-align:right;"><a href="http://stackoverflow.com">(stackoverflow</a> rep: 7576, <a href="http://projecteuler.net">Project Euler</a> 83/257 complete)</h6>
<div id="attachment_366" class="wp-caption alignleft" style="width: 260px"><img class="size-full wp-image-366" title="ducktape" src="http://grumpyop.files.wordpress.com/2009/09/ducktape.jpg?w=250&#038;h=272" alt="In my band days we called it &quot;Gaffer&quot;" width="250" height="272" /><p class="wp-caption-text">In my band days we called it &quot;Gaffer&quot;</p></div>
<p>Reading Joel&#8217;s<sup>1</sup> <a href="http://www.joelonsoftware.com/items/2009/09/23.html">Duct-Tape Programmer article</a> this morning (in the interests of full disclosure I should admit without additional prevarication that I have a large roll of &#8220;Duck&#8221; tape in the second drawer of my desk as I type) one sentence smacked me metaphorically between the eyes:</p>
<p>&#8220;Shipping is a feature&#8221;</p>
<p>I was transported back a couple of decades to the time when the bank for whom I was then working discovered that it was building not one but two settlement systems (the things that ensure that what traders agree should happen actually does) in two locations: London and Zurich. In London we were targeting our DEC VAX/Oracle platform, while the Swiss were designing with their local Tandem Non-Stop installation. And we&#8217;d both have gotten away with it if it hadn&#8217;t been for that meddling CEO&#8230;</p>
<p>It was decreed that The Wise Men (external auditors) be appointed to review the two projects and pronounce which should live and which should consign its members to the dole queue.</p>
<p>The Wise Ones duly decamped to Zurich to spend a few weeks working through the cabinets of meticulously-detailed standards-compliant design documentation that had been lovingly crafted over the past several months, with coding about to start. Then they came to see us. It didn&#8217;t look so good.</p>
<div id="attachment_372" class="wp-caption alignleft" style="width: 150px"><img class="size-full wp-image-372" title="Tipp-Ex" src="http://grumpyop.files.wordpress.com/2009/09/tipp-ex.jpg?w=140&#038;h=320" alt="dried-up and crusty now..." width="140" height="320" /><p class="wp-caption-text">dried-up and crusty now...</p></div>
<p>What documentation we had was months old (from a previous, aborted start of the <a href="http://www.it-director.com/technology/productivity/content.php?cid=7865">waterfall</a>) and coated in Tipp-Ex. Remember the white error-correction fluid we used all the time back in the 20th Century? When we still wrote &#8220;memos&#8221;? After a week of vagueness and frustration a set of presentations were scheduled for the Friday, at which we proposed to try to fill in the gaps.</p>
<div id="attachment_370" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/ch9sab/2249765677/in/set-72157603869382738"><img class="size-full wp-image-370" title="england2switz1" src="http://grumpyop.files.wordpress.com/2009/09/england2switz1.jpg?w=240&#038;h=173" alt="england2switz1" width="240" height="173" /></a><p class="wp-caption-text">Ing-er-land!</p></div>
<p>London won.</p>
<p>Yay us, but how? On most objective measurements we were deficient when compared with our continental rivals, even we agreed on that. But on that Friday afternoon, I got to stand up to summarise the differences, positive and negative between the two projects, as seen by the London team. I think what may have swung it was the part where I got to say &#8220;our <em>system</em> has been settling trades since 3 o&#8217;clock this morning&#8221;.</p>
<p>In about nine months, one team had done everything by the Book (don&#8217;t know the title, but I bet it had &#8220;Structured&#8221; in it) and had reached the point where they had, well, a book. Lots of books, in fact &#8211; they&#8217;d worked really hard. In the same time, we built a system and even better, shipped it. I don&#8217;t think anyone had written any Agile books by then &#8211; even if they had, we hadn&#8217;t read them.</p>
<p>Our team hadn&#8217;t done an awful job by any means, you understand: there&#8217;d been a few weeks of up-front requirement-gathering/scoping.  We had a massive data model that we Tipp-Exed down to the minimum needed. We had an outline architecture that, through luck or judgement, proved to be appropriate. Probably best of all, though, we sat with our users while we built their system. Better, as we built different features we moved around so we were always within speaking distance of our <a href="http://en.wikipedia.org/wiki/Domain_expert">domain expert</a> (I don&#8217;t think we&#8217;d done the whole &#8220;domain&#8221; thing then &#8211; we just called them &#8220;users&#8221;). So  we seldom got very far off track while stuff got built, and we were, with hindsight, feature-driven and relatively lowly-coupled/highly cohesive at the component level, all Good Things. Mostly written in COBOL, too.</p>
<p>Looking back, we were lucky: we didn&#8217;t manage to repeat the magic and fell back into time and cost overruns with the next couple of large projects. At least we were still being paid, unlike our erstwhile colleagues in Switzerland.</p>
<hr /><sup>1</sup> I call him by his first name because we share so much; we&#8217;re only a few slots apart on <a href="http://stackoverflow.com/users?page=13">page 13 of StackOverflow</a> as I write this. Page-mates, don&#8217;t you know.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=364&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/09/29/shippity-doo-dah/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/09/ducktape.jpg" medium="image">
			<media:title type="html">ducktape</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/09/tipp-ex.jpg" medium="image">
			<media:title type="html">Tipp-Ex</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/09/england2switz1.jpg" medium="image">
			<media:title type="html">england2switz1</media:title>
		</media:content>
	</item>
		<item>
		<title>The Hard Way</title>
		<link>http://grumpyop.wordpress.com/2009/09/15/the-hard-way/</link>
		<comments>http://grumpyop.wordpress.com/2009/09/15/the-hard-way/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 12:37:36 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[just plain weird]]></category>
		<category><![CDATA[installware]]></category>
		<category><![CDATA[strangeness]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=357</guid>
		<description><![CDATA[(stackoverflow rep: 7284, Project Euler 83/252 complete)
My main work PC was upgraded to IE7 yesterday. That&#8217;s one less IE6-infected machine to worry about. Unrelated to that (I suppose) is that the Aventail VPN product that I have to use each day decided it wanted to upgrade. I&#8217;m still trying to figure out how to make [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=357&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h6 style="text-align:right;"><a href="http://stackoverflow.com">(stackoverflow</a> rep: 7284, <a href="http://projecteuler.net">Project Euler</a> 83/252 complete)</h6>
<p>My main work PC was upgraded to IE7 yesterday. That&#8217;s one less IE6-infected machine to worry about. Unrelated to that (I suppose) is that the Aventail VPN product that I have to use each day decided it wanted to upgrade. I&#8217;m still trying to figure out how to make that work on IE7 but fortunately I also have an older machine that seems to have been immune to the upgrade, so I switched to that.</p>
<p>After some back-and-forth, I saw the happy news that this was happening:</p>
<div id="attachment_358" class="wp-caption alignnone" style="width: 395px"><img class="size-full wp-image-358" title="Seems_OK" src="http://grumpyop.files.wordpress.com/2009/09/seems_ok.png?w=385&#038;h=164" alt="All going acording to plan?" width="385" height="164" /><p class="wp-caption-text">All going according to plan?</p></div>
<p>While this was cogitating, a message popped up, partially obscured by the progress dialog. So I moved it. The dialog, that is, not the message. And I saw this:</p>
<div id="attachment_359" class="wp-caption alignnone" style="width: 436px"><img class="size-full wp-image-359" title="Then_Whoops" src="http://grumpyop.files.wordpress.com/2009/09/then_whoops.png?w=426&#038;h=200" alt="Whoops!" width="426" height="200" /><p class="wp-caption-text">Dude, where&#39;s my progress bar?</p></div>
<p>How confused must the developer of this part of the installer have been to have built the progress bar as an <strong>entirely separate window</strong>? And how much more difficult must it have been to do it that way? I amused myself dragging the main dialog all over my desktop while the progress bar stayed resolutely where it was until the install completed.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=357&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/09/15/the-hard-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/09/seems_ok.png" medium="image">
			<media:title type="html">Seems_OK</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/09/then_whoops.png" medium="image">
			<media:title type="html">Then_Whoops</media:title>
		</media:content>
	</item>
		<item>
		<title>Nothing Like A Name</title>
		<link>http://grumpyop.wordpress.com/2009/08/14/nothing-like-a-name/</link>
		<comments>http://grumpyop.wordpress.com/2009/08/14/nothing-like-a-name/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 16:57:15 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=245</guid>
		<description><![CDATA[(stackoverflow rep: 6622, Project Euler 82/252 complete)
I was suddenly plunged head-first back into the world of Excel/VBA this week. After a year or so of mostly Ruby coding, I was struck by how, well, wordy VBA can be by comparison. There&#8217;s a definite lower level of expressiveness, too, although that can be mitigated to some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=245&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h6 style="text-align:right;"><a href="http://stackoverflow.com">(stackoverflow</a> rep: 6622, <a href="http://projecteuler.net">Project Euler</a> 82/252 complete)</h6>
<p>I was suddenly plunged head-first back into the world of Excel/VBA this week. After a year or so of mostly Ruby coding, I was struck by how, well, <em>wordy</em> VBA can be by comparison. There&#8217;s a definite lower level of expressiveness, too, although that can be mitigated to some extent with extra (mostly mental) effort. While I was rapidly back up to speed and having a good time refactoring to make room for some new functions, I couldn&#8217;t help feeling that I&#8217;d moved on and was practising what had become a legacy skill. That has happened before: I left COBOL behind (without a second glance, it must be said) in 1990 and have not written a line in it since.</p>
<p>Anyway, I was thinking about named ranges in excel, and how they aren&#8217;t. Named ranges, I mean. Well they are, but they&#8217;re not. A name can refer to a range, but it&#8217;s really referring to a formula that references a range.</p>
<p><img class="size-full wp-image-246" title="new_name" src="http://grumpyop.files.wordpress.com/2009/04/new_name.png?w=320&#038;h=240" alt="new_name" width="320" height="240" /></p>
<p>And by formula, I mean anything (pretty much) that can be input into a cell after an equals sign. The result need not be a range. Want to define a named constant, Faraday&#8217;s Constant (96485.3399) say? Just define a name with &#8220;<code>=96485.3399</code>&#8221; as the &#8220;Refers to&#8221; value.</p>
<p>In older Excels, you&#8217;d get this:</p>
<div id="attachment_335" class="wp-caption alignnone" style="width: 420px"><img class="size-full wp-image-335" title="DefinenamedConstant" src="http://grumpyop.files.wordpress.com/2009/08/definenamedconstant.png?w=410&#038;h=251" alt="Named constant - in a Name" width="410" height="251" /><p class="wp-caption-text">Named constant - in a Name</p></div>
<p>I&#8217;m a huge fan of using names to define OFFSET range for charting:</p>
<div id="attachment_336" class="wp-caption alignnone" style="width: 420px"><img class="size-full wp-image-336" title="NamedOffsetFormula" src="http://grumpyop.files.wordpress.com/2009/08/namedoffsetformula.png?w=410&#038;h=251" alt="SwimDateCount is also a formula..." width="410" height="251" /><p class="wp-caption-text">SwimDateCount, in turn, is =COUNT(SwimStats!$A$2:$A$500)</p></div>
<p>The excellent <a href="http://www.amazon.co.uk/Professional-Excel-Development-Definitive-Applications/dp/0321262506">Professional Excel Development</a> (I have the older edition; I&#8217;m sure the new one will be just as good when I finally start working with 2007/2010 in anger) covers this, I&#8217;m sure. I&#8217;d check, but it&#8217;s been borrowed by a colleague. Because it&#8217;s that good.</p>
<p>The only slightly less excellent <a href="http://www.amazon.co.uk/Excel-Hacks-Tools-Streamlining-Spreadsheets/dp/0596528345">Excel Hacks</a> definitely does cover it. (Also borrowed, but I managed to find it). Hack #52 in my copy, if you&#8217;re interested.</p>
<p><img src="/Users/Mike/AppData/Local/Temp/moz-screenshot.jpg" alt="" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=245&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/08/14/nothing-like-a-name/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/04/new_name.png" medium="image">
			<media:title type="html">new_name</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/08/definenamedconstant.png" medium="image">
			<media:title type="html">DefinenamedConstant</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/08/namedoffsetformula.png" medium="image">
			<media:title type="html">NamedOffsetFormula</media:title>
		</media:content>

		<media:content url="/Users/Mike/AppData/Local/Temp/moz-screenshot.jpg" medium="image" />
	</item>
		<item>
		<title>A Long Time Dead</title>
		<link>http://grumpyop.wordpress.com/2009/08/12/a-long-time-dead/</link>
		<comments>http://grumpyop.wordpress.com/2009/08/12/a-long-time-dead/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 12:50:49 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=327</guid>
		<description><![CDATA[(stackoverflow rep: 6602, Project Euler 78/252 complete)
I realised just now that Visual Basic1 went from 1.0 to 6.02 in about 7 years and stopped progressing 11 years ago. Even so, if I needed to do some COM automation work in an EXE, it&#8217;s still the tool I&#8217;d reach for, assuming I could locate my old [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=327&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h6 style="text-align:right;"><a href="http://stackoverflow.com">(stackoverflow</a> rep: 6602, <a href="http://projecteuler.net">Project Euler</a> 78/252 complete)</h6>
<p>I realised just now that Visual Basic<sup>1</sup> went from 1.0 to 6.0<sup>2</sup> in about 7 years and stopped progressing 11 years ago. Even so, if I needed to do some COM automation work in an EXE, it&#8217;s still the tool I&#8217;d reach for, assuming I could locate my old <a href="http://windowsitpro.com/article/articleid/17345/microsoft-previews-visual-studio-98.html">Visual Studio 98</a> CD-ROMS, that is.</p>
<p>So by now VB&#8217;s pretty much been end-of-life longer than it&#8217;s been, er, life. Golly. It really is time Microsoft came up with a viable alternative. What I can figure out about <a href="http://blogs.msdn.com/vsta/">VSTA</a> doesn&#8217;t fill me with excitement, that&#8217;s for sure. <a href="http://msdn.microsoft.com/en-us/vsto/default.aspx">VSTO</a>, for the power-user at least (emphasis on &#8220;user&#8221;) still looks even worse. Neither offers, as far as I can see, any route for legacy VBA code, which is, I suppose, why VBA is still expected to be around for the foreseeable future.</p>
<p>Still, for the little it&#8217;s probably worth, we now have <a href="http://makeofficebetter.com">Make Office Better</a>, within which we can rant about such importances. The buzz following its appearance seems to suggest that Microsoft still have some way to go. I am looking forward to <a href="http://blogs.msdn.com/excel/archive/2009/07/17/sparklines-in-excel.aspx">sparklines in Excel 2010</a> though&#8230;</p>
<div id="attachment_331" class="wp-caption aligncenter" style="width: 176px"><img class="size-full wp-image-331" title="mmm_sparklines" src="http://grumpyop.files.wordpress.com/2009/08/mmm_sparklines.png?w=166&#038;h=121" alt="Mmmmm, sparklines..." width="166" height="121" /><p class="wp-caption-text">Mmmmm, sparklines...</p></div>
<p><sup>1</sup> (the &#8220;classic&#8221; one, not the impossibly confusing &#8211; to a still-active VBA user)<br />
<sup>2</sup> did we ever get a point release? I can&#8217;t remember any, although some of the ActiveX stuff did get service-packed.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/327/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=327&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/08/12/a-long-time-dead/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/08/mmm_sparklines.png" medium="image">
			<media:title type="html">mmm_sparklines</media:title>
		</media:content>
	</item>
		<item>
		<title>Johnny 99</title>
		<link>http://grumpyop.wordpress.com/2009/07/03/johnny-99/</link>
		<comments>http://grumpyop.wordpress.com/2009/07/03/johnny-99/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 11:20:27 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[legacy]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=290</guid>
		<description><![CDATA[Sometimes I write legacy code. There, I&#8217;ve said it. The secret&#8217;s out, the dirty laundry&#8217;s aired and the cat&#8217;s out of Pandora&#8217;s box.
I don&#8217;t think it makes me a bad person. I understand the value of tests, especially in the highly incremental development world I currently inhabit, and I strive to use tests to drive [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=290&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometimes I write legacy code. There, I&#8217;ve said it. The secret&#8217;s out, the dirty laundry&#8217;s aired and the cat&#8217;s out of Pandora&#8217;s box.</p>
<p>I don&#8217;t think it makes me a bad person. I understand the value of tests, especially in the highly incremental development world I currently inhabit, and I strive to use tests to drive my code. Sometimes it doesn&#8217;t happen, for many reasons, none of which I&#8217;m proud of, such as my Excel test framework being a little clumsy, there not being anyone around me to nag, the &#8220;quick&#8221; change that turns into just a little more uncovered code than I expected (but it works and the user needs it Right Now).</p>
<p>I understand that all that code sitting in the wild in an uncovered state is Legacy and represents an accumulation of <a href="http://www.martinfowler.com/bliki/TechnicalDebt.html">Technical Debt</a> that will have to be repaid. By me.</p>
<p>It&#8217;s not that code without tests is necessarily bad. I mean, heck, even <a href="http://en.wikipedia.org/wiki/Kent_Beck">Kent</a> <a href="http://www.threeriversinstitute.org/">Beck</a> sometimes <a href="http://www.threeriversinstitute.org/blog/?p=187">flies without a safety net</a>. If it&#8217;s write-once-and-throw-away code, then there&#8217;s an argument for just getting it done. But honestly, how often does that code get resurrected months, maybe years later? It&#8217;s when code needs to be changed, often requiring some refactoring in the process, that the absence of that warm, covered-by-tests feeling starts to be felt.</p>
<div id="attachment_292" class="wp-caption alignright" style="width: 225px"><img class="size-full wp-image-292" title="rusted_nuts" src="http://grumpyop.files.wordpress.com/2009/06/rusted_nuts.png?w=215&#038;h=240" alt="Still there, still doing a job, but just try changing it..." width="215" height="240" /><p class="wp-caption-text">Still there, still doing a job, but just try changing it...</p></div>
<p>The trouble with beginning to repay technical debt is that interest tends to accrue, compounded, at some arbitrary (but almost always positive) rate. So no matter how trivial the original untest-covered change seems to have been, the longer you leave it, the more unpleasantness tends to have accreted around it by the time you come back to it. I suppose there&#8217;s always the possibility that you&#8217;ll come back to discover a glistening pearl, but in my programming life I&#8217;ve never returned to anything other than a thick coating of rust.</p>
<p>Worse than that, getting the encrusted nodule of code under test usually turns out to be painful: it&#8217;s seldom structured as it would have been had tests been used in the first place, so unwanted and hard-to-separate interdependencies are rife and the whole thing becomes, well, <a href="http://www.youtube.com/watch?v=nCWYhRwQSLg">a bit tricky</a>.</p>
<p>I&#8217;d been meaning to buy <a href="http://michaelfeathers.typepad.com/">Michael</a> <a href="http://twitter.com/mfeathers">Feathers</a>&#8216; &#8220;<a href="http://www.amazon.co.uk/Working-Effectively-Legacy-Robert-Martin/dp/0131177052">Working Effectively with Legacy Code</a>&#8221; for years and recently got around to buying it. Scott Hanselman&#8217;s <a href="http://www.hanselman.com/blog/HanselminutesPodcast165WorkingEffectivelyWithLegacyCodeWithMichaelFeathers.aspx">interview</a> last week with Mr Feathers was a serendipitous bonus. The book, even for non-Java or C++ programmers, is excellent, full of practical advice on how to break things up in a way that can let you get tests around the locus of change. In fact, when you see how just plain <em>nasty</em> working with C++ code can be, working with code in any other language starts to look like a breeze.</p>
<p>I wish I&#8217;d read the book earlier.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=290&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/07/03/johnny-99/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/06/rusted_nuts.png" medium="image">
			<media:title type="html">rusted_nuts</media:title>
		</media:content>
	</item>
		<item>
		<title>The Glove Puppet Programmer</title>
		<link>http://grumpyop.wordpress.com/2009/06/12/the-glove-puppet-programmer/</link>
		<comments>http://grumpyop.wordpress.com/2009/06/12/the-glove-puppet-programmer/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 13:38:02 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Ancient History]]></category>
		<category><![CDATA[Black Museum]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=303</guid>
		<description><![CDATA[While I prevaricate over the four (!) drafts sitting at various stages of incompletion in my &#8220;Posts&#8221; view, I&#8217;ll take lunchtime out to reminisce about a non-contemporaneous* colleague and his unique status as probably the most expensive programmer I&#8217;ve ever had to deal with.
This particular individual, who was either French or French Canadian, had the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=303&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>While I prevaricate over the four (!) drafts sitting at various stages of incompletion in my &#8220;Posts&#8221; view, I&#8217;ll take lunchtime out to reminisce about a non-contemporaneous* colleague and his unique status as probably the most expensive programmer I&#8217;ve ever had to deal with.</p>
<p>This particular individual, who was either French or French Canadian, had the singular identifying characteristic of a name that was a literal translation of a stuffed children&#8217;s TV character from my childhood. This in itself should have been a warning.<img class="alignright size-full wp-image-304" title="basil_brush" src="http://grumpyop.files.wordpress.com/2009/06/basil_brush.png?w=179&#038;h=238" alt="basil_brush" width="179" height="238" /> He had created the Credit Risk reporting system that a team of ten expensive contractors, myself including, were labouring feverishly to replace. On his own. As a series of Excel spreadsheets. With extensive VBA macros, coming from no discernible programming background. If you&#8217;re wincing, I&#8217;m not surprised.</p>
<p>Why am I asserting he was peerless in the cost stakes? Because the application he&#8217;d built actually <em>worked</em>. Badly, slowly, requiring regular manual intervention, occasionally obviously inaccurate and more frequently rather less so, but it worked. And we were trying to reverse-engineer it**, distinguish between the right and wrong parts and deliver something that was everything the old &#8220;system&#8221; was not. Well, almost: we did need our system to work.</p>
<p>This is one of the gems I discovered in the VBA:</p>
<pre class="brush: vb;">
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 0).value = bv_sSTRATEGY
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 1).value = bv_sTRADENAME
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 2).value = bv_sTRADESTATUS
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 3).value = bv_sStructType
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 4).value = bv_sSTRUCTMODEL
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 5).value = bv_sTRANCHENAME
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 6).value = bv_iTRANCHENUMBER
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 7).value = bv_lTRANCHENOTIONAL

    ... are you getting the picture? We continue incrementing the offset for a while, until:

    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 29).value = bv_sCOMMENTDEFAULT
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 30).value = bv_sNEWTRANSID
    br_OutputWB.Worksheets(bv_sOutPutWSName).Range(&quot;A1&quot;).offset(br_lCount + 1, 31).value = bv_sCOMMENT
</pre>
<p>In case you were wondering, the “bv_” prefix signifies “By Value.” And yes, that does mean that each of those values appeared as parameter to the routine. I counted 32 in total. That&#8217;s thirty-two input parameters. You really should be wincing by now.</p>
<p><img class="alignleft size-full wp-image-314" title="goggles" src="http://grumpyop.files.wordpress.com/2009/06/goggles.png?w=162&#038;h=115" alt="goggles" width="162" height="115" />Several <em>other</em> routines <em>also</em> had the same (or 99% the same) code blocks. Our friend the cut-and-paste programmer must have really earned his money that day…</p>
<p>Oh yes, you should see an example of how our chum called his parameter-heavy subroutines. Consider acquiring welding goggles before looking at this, by the way.</p>
<pre class="brush: vb;">
Call SS_BuildMTMByTrade(br_OutputWB:=OutputWB, br_lCount:=lMMcount_SS, bv_dbFXrate:=GetFXRate(vMM_FXRates, RgCursor.offset(lOffset, Range(&quot;TRANCHECCY&quot;).Column - 1).value), _
bv_sSourceFile:=m_sSS_MM_Source &amp; IIf(bv_sTradeNamePrefix &lt;&gt; &quot;&quot;, bv_sTradeNamePrefix &amp; RgCursor.offset(lOffset, Range(&quot;TRADENAME&quot;).Column - 1).value, RgCursor.offset(lOffset, Range(&quot;TRADENAME&quot;).Column - 1).value) &amp; &quot;_&quot; &amp; &quot;MM&quot; &amp; &quot;_&quot; &amp; RgCursor.offset(lOffset, Range(&quot;MM_CSB&quot;).Column - 1).value &amp; &quot;_&quot; &amp; RgCursor.offset(lOffset, Range(&quot;MM_R&quot;).Column - 1).value &amp; &quot;_&quot; &amp; IIf(RgCursor.offset(lOffset, Range(&quot;MM_PW&quot;).Column - 1).value, &quot;T&quot;, &quot;F&quot;) &amp; &quot;_&quot; &amp; IIf(RgCursor.offset(lOffset, Range(&quot;MM_SCS&quot;).Column - 1).value, &quot;T&quot;, &quot;F&quot;) &amp; &quot;_&quot; &amp; Format(m_dSS_MM_Asof, &quot;yyyymmdd&quot;) &amp; &quot;.xls&quot;, bv_dbParticipationFactor:=RgCursor.offset(lOffset, Range(&quot;DEALNOTIONAL&quot;).Column - 1).value / RgCursor.offset(lOffset, Range(&quot;TRANCHENOTIONAL&quot;).Column - 1).value, bv_iShift:=RgCursor.offset(lOffset, Range(&quot;MM_R&quot;).Column - 1).value, bv_bIgnoreFirstCprty:=CBool(RgCursor.offset(lOffset, Range(&quot;IGNORECPTY&quot;).Column - 1).value), _
bv_dbSpread:=RgCursor.offset(lOffset, Range(&quot;DEALSPREADBP&quot;).Column - 1).value, _
bv_bUsePVFormula:=RgCursor.offset(lOffset, Range(&quot;USEPVFORMULA&quot;).Column - 1).value, _
bv_sSTRATEGY:=RgCursor.offset(lOffset, Range(&quot;STRATEGY&quot;).Column - 1).value, _
bv_sTRADENAME:=IIf(bv_sTradeNamePrefix &lt;&gt; &quot;&quot;, bv_sTradeNamePrefix &amp; RgCursor.offset(lOffset, Range(&quot;TRADENAME&quot;).Column - 1).value, RgCursor.offset(lOffset, Range(&quot;TRADENAME&quot;).Column - 1).value), _
bv_sTRADESTATUS:=RgCursor.offset(lOffset, Range(&quot;TRADESTATUS&quot;).Column - 1).value, _
bv_sStructType:=RgCursor.offset(lOffset, Range(&quot;STRUCTTYPE&quot;).Column - 1).value, bv_sSTRUCTMODEL:=RgCursor.offset(lOffset, Range(&quot;STRUCTMODEL&quot;).Column - 1).value, _
bv_sTRANCHENAME:=RgCursor.offset(lOffset, Range(&quot;TRANCHENAME&quot;).Column - 1).value, bv_iTRANCHENUMBER:=RgCursor.offset(lOffset, Range(&quot;TRANCHENUMBER&quot;).Column - 1).value, bv_lTRANCHENOTIONAL:=RgCursor.offset(lOffset, Range(&quot;TRANCHENOTIONAL&quot;).Column - 1).value, bv_sTRANCHESUBORDINATION:=RgCursor.offset(lOffset, Range(&quot;TRANCHESUBORDINATION&quot;).Column - 1).value, bv_sTRANCHECCY:=RgCursor.offset(lOffset, Range(&quot;TRANCHECCY&quot;).Column - 1).value, bv_dtTRANCHEMATURITY:=RgCursor.offset(lOffset, Range(&quot;TRANCHEMATURITY&quot;).Column - 1).value, _
bv_sBUYSELL:=RgCursor.offset(lOffset, Range(&quot;BUYSELL&quot;).Column - 1).value, _
bv_lDEALNOTIONAL:=RgCursor.offset(lOffset, Range(&quot;DEALNOTIONAL&quot;).Column - 1).value, _
bv_iDEALSPREADBP:=RgCursor.offset(lOffset, Range(&quot;DEALSPREADBP&quot;).Column - 1).value, _
bv_sUPFRONTFEE:=RgCursor.offset(lOffset, Range(&quot;UPFRONTFEE&quot;).Column - 1).value, _
bv_sCOUNTERPARTY:=RgCursor.offset(lOffset, Range(&quot;COUNTERPARTY&quot;).Column - 1).value, _
bv_dtTRADEDATE:=RgCursor.offset(lOffset, Range(&quot;TRADEDATE&quot;).Column - 1).value, _
bv_dtSETTLMTDATE:=RgCursor.offset(lOffset, Range(&quot;SETTLMTDATE&quot;).Column - 1).value, _
bv_sREPACKVEHICLE:=RgCursor.offset(lOffset, Range(&quot;REPACKVEHICLE&quot;).Column - 1).value, _
bv_sCOMMENT:=RgCursor.offset(lOffset, Range(&quot;COMMENT&quot;).Column - 1).value, _
bv_lADRNOTIONAL:=RgCursor.offset(lOffset, Range(&quot;ADRN&quot;).Column - 1).value, _
bv_sCOMMENTDEFAULT:=RgCursor.offset(lOffset, Range(&quot;COMMENTDEFAULT&quot;).Column - 1).value, _
bv_sNEWTRANSID:=RgCursor.offset(lOffset, Range(&quot;NEWTRANSID&quot;).Column - 1).value, _
bv_sOutPutWSName:=MMTEMPSHEETNAME, _
bv_BookName:=RgCursor.offset(lOffset, Range(&quot;BOOKNAME&quot;).Column - 1).value, bv_UniqueID:=RgCursor.offset(lOffset, Range(&quot;UNIQUEID&quot;).Column - 1).value, bv_KMVCorr:=RgCursor.offset(lOffset, Range(&quot;KMVCORR&quot;).Column - 1).value, bv_MarketCorr:=RgCursor.offset(lOffset, Range(&quot;MARKETCORR&quot;).Column - 1).value, bv_RunFlag:=RgCursor.offset(lOffset, Range(&quot;RUNLISTFLAG&quot;).Column - 1).value, bv_DataSource:=RgCursor.offset(lOffset, Range(&quot;SOURCETYPE&quot;).Column - 1).value)
</pre>
<p>The second line is about 900 characters long. Nine. Hundred. If you&#8217;re starting to want to make it go away, perhaps by clawing out your eyeballs, I don&#8217;t blame you.</p>
<p>Finally, for dessert, if you will, or maybe like one of those hot steamy towels presented at the end of some Indian meals, here&#8217;s our friend&#8217;s take on copying an array:</p>
<pre class="brush: vb;">
Public Sub CopyArray(ByVal bv_FromArray As Variant, ByRef br_ToArray() As Variant)
    Dim l As Long
    Dim i As Integer

    For l = LBound(bv_FromArray, 2) To UBound(bv_FromArray, 2)
        ReDim Preserve br_ToArray(1, l)
        For i = LBound(bv_FromArray, 1) To UBound(bv_FromArray, 1)
        Debug.Print bv_FromArray(i, l)

            br_ToArray(i, l) = bv_FromArray(i, l)
        Next
    Next

End Sub
</pre>
<p>From the blank line following the &#8220;Debug.Print&#8221; line I surmise that some operation may, in the distant past, have been occurring that made the routine more than a criminal waste of electricity. I hope the use of lower-case &#8220;L&#8221; is a soothing balm to your eyes, as is the continuous &#8220;ReDim Preserve&#8221; of the outer loop&#8230;</p>
<p>I don&#8217;t know the final cost of the project that replaced this, I elected not to renew my contract after nine months. I&#8217;d guess it didn&#8217;t exceed $10 million, not counting the possible losses incurred from trading on inaccurate information in the several years the &#8220;system&#8221; was live.</p>
<p>I&#8217;d call that dangerous.</p>
<hr />
<p>*we worked at the same place but not at the same time, if that makes any sense</p>
<p>** specs? Don&#8217;t be ridiculous.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=303&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/06/12/the-glove-puppet-programmer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/06/basil_brush.png" medium="image">
			<media:title type="html">basil_brush</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/06/goggles.png" medium="image">
			<media:title type="html">goggles</media:title>
		</media:content>
	</item>
		<item>
		<title>harrylillis.com would probably have been cheaper</title>
		<link>http://grumpyop.wordpress.com/2009/06/02/harrylillis-com-would-probably-have-been-cheaper/</link>
		<comments>http://grumpyop.wordpress.com/2009/06/02/harrylillis-com-would-probably-have-been-cheaper/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 10:13:36 +0000</pubDate>
		<dc:creator>mikewoodhouse</dc:creator>
				<category><![CDATA[Web technology]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://grumpyop.wordpress.com/?p=297</guid>
		<description><![CDATA[Putting 2 and 2 together, Jeff Atwood appears to have paid* a fairly large (to me) sum to acquire the superuser.com domain. I wonder how much Microsoft paid for bing.com?
I switched my default search engine to Microsoft&#8217;s new beta search engine yesterday. Today I switched back to Google. Not that bing was all that bad [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=297&subd=grumpyop&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Putting 2 and 2 together, Jeff Atwood <a href="http://twitter.com/codinghorror/status/1965603283">appears to have paid</a>* a fairly large (to me) sum to <a href="http://blog.stackoverflow.com/2009/05/the-stack-overflow-trilogy/">acquire</a> the <a href="http://superuser.com/">superuser.com</a> domain. I wonder how much Microsoft paid for <a href="http://bing.com">bing.com</a>?</p>
<p>I switched my default search engine to Microsoft&#8217;s new beta <a href="http://www.bing.com">search engine</a> yesterday. Today I switched back to Google. Not that bing was all that bad &#8211; to be honest I couldn&#8217;t see much difference between what it gave me and what I see from Google. The background picture, which I guessed was of some Greek island yesterday (it&#8217;s somewhere different, but similarly attractive today) was certainly pleasant.</p>
<p>The killer was that after Firefox (3.0.10) reported that the page load was &#8220;Done&#8221; (and the results certainly seemed to be present) there was a delay &#8211; during which time FF froze completely &#8211; of about 12 seconds, after which my browser shook itself and woke up.</p>
<div id="attachment_298" class="wp-caption alignnone" style="width: 347px"><img class="size-full wp-image-298" title="MS_being_annoying" src="http://grumpyop.files.wordpress.com/2009/06/ms_being_annoying.png?w=337&#038;h=142" alt="I don't need to search to find Microsoft being annoying..." width="337" height="142" /><p class="wp-caption-text">I don&#39;t need to search to find Microsoft being annoying...</p></div>
<p>Bing could be the best search engine in the world ever and I&#8217;d still not use it if that delay were present. I can&#8217;t believe it occurs for all users for all browsers but I&#8217;m only me and I prefer FireFox. It could be some interaction with one or more of my &#8211; fairly standard &#8211; plugins. Maybe I&#8217;ll try it again when the beta is done.</p>
<p>Your mileage, of course, may vary.</p>
<p>* Unless of course he was tweeting about another one, which is entirely possible.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grumpyop.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grumpyop.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grumpyop.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grumpyop.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grumpyop.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grumpyop.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grumpyop.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grumpyop.wordpress.com/297/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grumpyop.wordpress.com/297/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grumpyop.wordpress.com/297/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grumpyop.wordpress.com&blog=4487201&post=297&subd=grumpyop&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://grumpyop.wordpress.com/2009/06/02/harrylillis-com-would-probably-have-been-cheaper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5978e2ed3a31f1bd2361dbb919d92012?s=96&#38;d=" medium="image">
			<media:title type="html">mikewoodhouse</media:title>
		</media:content>

		<media:content url="http://grumpyop.files.wordpress.com/2009/06/ms_being_annoying.png" medium="image">
			<media:title type="html">MS_being_annoying</media:title>
		</media:content>
	</item>
	</channel>
</rss>