<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>vba &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/vba/</link>
	<description>Feed of posts on WordPress.com tagged "vba"</description>
	<pubDate>Sat, 28 Nov 2009 18:39:32 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Excel Training Day]]></title>
<link>http://dmoffat.wordpress.com/2009/11/27/excel-training-day/</link>
<pubDate>Fri, 27 Nov 2009 14:14:16 +0000</pubDate>
<dc:creator>Dick Moffat</dc:creator>
<guid>http://dmoffat.wordpress.com/2009/11/27/excel-training-day/</guid>
<description><![CDATA[Yesterday I did a full-day training session in Excel 2003 at a local Auto-Parts manufacturer (yes th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Yesterday I did a full-day training session in Excel 2003 at a local Auto-Parts manufacturer (yes there are a few left) and despite not much enthusiasm on my part going in, it turned out to be a satisfying and inspiring event for me (and apparently for them too). </p>
<p>I used to teach several sessions a week back in the 90&#8217;s but became so discouraged by the inability of so many people to appreciate what was sitting in front of them in Excel, even then, that I stopped promoting training.  If people don&#8217;t want to learn this stuff then I&#8217;ll sell them MY skills instead.  It has worked pretty good for ME, if not so good for those  missing out on what they COULD be doing themselves.</p>
<p>But yesterday I added a section from my seminar recently give in Holland, at the fantastic SDN Conference, called &#8220;Excel Development &#8211; Rules of Engagement&#8221;, in addition to the standard overview of SUMIF and IF() and Date and String functions.  In this section I talked about WHY you would use Excel and how to best organize your spreadsheets to optimize their re-use and their interaction with corporate data sources and each other (things like using a Query Table to automatically draw in Product data from a central single source) and why you have to use Protection both for the workbook and the Worksheet even if YOU are the principal user.  I also FINALLY got to teach somebody the powers of the &#8220;Lists&#8221; in Excel (now even more capable as &#8220;Tables&#8221; in 2007 and 2010).</p>
<p>They got it &#8211; or seemed to anyway.</p>
<p>If anyone is interested in this training session feel free to contact me at <a href="mailto:dick@plogic.on.ca">dick@plogic.on.ca</a> and I&#8217;d be glad to provide the session either in person or even on-line to your company (for a reasonable fee plus costs of course <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<p>But regardless of whether I do this session again, I am at least inspired for one day.</p>
<p>Dick</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Excel 'Could not get the List property' error.]]></title>
<link>http://dutchgemini.wordpress.com/2009/11/27/excel-could-not-get-the-list-property-error/</link>
<pubDate>Fri, 27 Nov 2009 13:55:11 +0000</pubDate>
<dc:creator>dutchgemini</dc:creator>
<guid>http://dutchgemini.wordpress.com/2009/11/27/excel-could-not-get-the-list-property-error/</guid>
<description><![CDATA[If you ever bump into the &#8216;Could not get the List property. Not enough storage space is availa]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If you ever bump into the &#8216;<em>Could not get the List property. Not enough storage space is available to complete this operation</em>&#8216; error in Excel, then you are likely to be using a <strong>ListBox</strong> either as an ActiveX control on the sheet or as a ListBox control on a UserForm, that is<strong> linked to a Range</strong> on one of your worksheets and you trying to obtain the ListBox&#8217;s <strong><code>.Value</code></strong> property (usually the default property) .</p>
<div>This error can occur for 2 reasons:</div>
<ol>
<li>your ListBox does not have a valid <strong><code>.ListFillRange</code></strong>, i.e. empty or pointing to an invalid Range. The <strong><code>.ListFillRange</code></strong> property tells Excel the Range of a sheet in the workbook that contains the data used to populate the list</li>
<li>your ListBox contains a textual entry that is not part of the accepted values</li>
</ol>
<p>An invalid Range occurs when for instance you delete the sheet or the range it points to. Excel is unable to make the match and returns the above error.</p>
<p>In my case the error came up while using an ActiveX ComboBox with 2 columns pointing to a 2 column range and hiding the first column (Setting the <code>.ColumnWidths</code> to &#8216;<code>0 pt; 150 pt</code>&#8216;).</p>
<p>Dutch</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Learning VBA]]></title>
<link>http://roymacleanvba.wordpress.com/2009/11/26/learning-vba/</link>
<pubDate>Thu, 26 Nov 2009 14:27:26 +0000</pubDate>
<dc:creator>Roy MacLean</dc:creator>
<guid>http://roymacleanvba.wordpress.com/2009/11/26/learning-vba/</guid>
<description><![CDATA[Interesting post (and comments) over at Daily Dose of Excel (referencing another post). Basically sa]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.dailydoseofexcel.com/archives/2009/11/18/learn-vba-to-be-lean/">Interesting post</a> (and comments) over at Daily Dose of Excel (referencing <a href="http://leanexecution.wordpress.com/2009/11/12/lean-spreadsheets-for-office-applications/">another post</a>). Basically saying that people should be learning and using (a bit of) VBA, as part of their basic efficiency/productivity &#8211; assuming they use Office apps, of course. For example, you wonder how many people copy-and-paste quantities of data manually (probably making mistakes) on a regular basis, when a few lines of code would do it for them.</p>
<p>Unfortunately, it is part of our culture that programming is regarded as something terribly technical and obscure, not for ordinary people. Microsoft themselves are at fault for putting ever more layers of user interface in front of the application functionality. Lots of PC users do not know what a Command Prompt is. I admit that VBA as a language is a bit quirky and inconsistent (the <a href="http://roymacleanvba.wordpress.com/2009/05/08/set-keyword/">Set Keyword</a>, for example), but it&#8217;s not unusable.</p>
<p>There&#8217;s a similar issue over in the domain of <a href="http://roymacleanvba.wordpress.com/2009/08/25/digression-on-documentation-dita/">XML documentation</a>. There are technical writers (&#8216;technical&#8217;, note) who feel that everything should be entirely wrapped up in a GUI. This might be feasible if you are prepared to do what the tools let you do, and nothing else. But I think having some knowledge of the underlying languages is helpful.</p>
<p>It also allows you to use the many free tools, which tend to be light on GUIs. For example, a set of XML document files on disk can be queried (and even updated) using the XQuery language, effectively turning the files into a content database. XQuery is a very clean, functional language, with a SELECT-like construct to do the querying (much easier than VBA!). There are free (versions of) <a href="http://www.xmlmind.com/qizx/">tools </a>that index files and run queries.</p>
<p>So, yes, I think that there should be greater encouragement for &#8217;serious&#8217; users of tools to roll their sleeves up and get into some (gentle or not so gentle) programming. At least they&#8217;d appreciate a bit more what developers do!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Multiple Selected Worksheets]]></title>
<link>http://roymacleanvba.wordpress.com/2009/11/26/multiple-selected-worksheets/</link>
<pubDate>Thu, 26 Nov 2009 13:00:59 +0000</pubDate>
<dc:creator>Roy MacLean</dc:creator>
<guid>http://roymacleanvba.wordpress.com/2009/11/26/multiple-selected-worksheets/</guid>
<description><![CDATA[Here&#8217;s a question that came up on a recent course. In Excel, suppose that you have shift-click]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Here&#8217;s a question that came up on a recent course. In Excel, suppose that you have shift-clicked or control-clicked to select multiple worksheets. Are they all Active? If so, what does <em>ActiveSheet </em>return? If not, where is the set of selected sheets?</p>
<p>The answer is that there is only one <em>ActiveSheet</em>: the one on the top of the stack, with the name in bold. The set of selected sheets is held by the <em>SelectedSheets</em> property (reasonably enough) of a <em>Window </em>object. This is a <em>Sheets </em>collection, which can contain both worksheets and (free-standing) Charts. The Workbook holds the full <em>Sheets </em>collection, of which a Window&#8217;s <em>SelectedSheets </em>is obviously a subset.</p>
<p>The <em>Window </em>objects are held both by a Workbook (usually just one) and Application (the full set for all open Workbooks). A Window holds appearance-related properties, such as scrolling and splitting. A Window does not raise any events, so there does not seem to be anything corresponding to the shift-click or control-click actions (not that I can think what you would want to do on handling them).</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Daniel's XL Toolbox]]></title>
<link>http://newtonexcelbach.wordpress.com/2009/11/25/daniels-xl-toolbox/</link>
<pubDate>Wed, 25 Nov 2009 12:06:36 +0000</pubDate>
<dc:creator>dougaj4</dc:creator>
<guid>http://newtonexcelbach.wordpress.com/2009/11/25/daniels-xl-toolbox/</guid>
<description><![CDATA[I downloaded this yesterday: Daniel&#8217;s XL Toolbox &#8220;Daniel&#8217;s XL Toolbox is a free, o]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I downloaded this yesterday: <a href="http://xltoolbox.sourceforge.net/index.html">Daniel&#8217;s XL Toolbox</a></p>
<p>&#8220;Daniel&#8217;s XL Toolbox is a free, open source add-in for Excel® that helps you to analyze and present data.&#8221;</p>
<p>See the link for a full description.</p>
<p>I&#8217;ve only had a brief look, but with open-source code, including a nice customised ribbon, it should be worth a look.</p>
<div id="attachment_1257" class="wp-caption aligncenter" style="width: 478px"><a href="http://newtonexcelbach.wordpress.com/files/2009/11/danielsribbon.jpg"><img class="size-full wp-image-1257" title="DanielsRibbon" src="http://newtonexcelbach.wordpress.com/files/2009/11/danielsribbon.jpg" alt="" width="468" height="86" /></a><p class="wp-caption-text">The Ribbon (click for full size view)</p></div>
<p> <a href="http://sourceforge.net/apps/wordpress/xltoolbox/">Developer&#8217;s Blog</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[The world according to smurf]]></title>
<link>http://smurfonspreadsheets.wordpress.com/2009/11/23/the-world-according-to-smurf/</link>
<pubDate>Mon, 23 Nov 2009 10:29:37 +0000</pubDate>
<dc:creator>Simon</dc:creator>
<guid>http://smurfonspreadsheets.wordpress.com/2009/11/23/the-world-according-to-smurf/</guid>
<description><![CDATA[I&#8217;ve had a few chats with Ross over at MIE this last week. One result of that is this podcast ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="excel podcasts" href="http://www.blog.methodsinexcel.co.uk/2009/11/22/excel-podcasts-exciting-times/" target="_blank">I&#8217;ve had a few chats with Ross over at MIE this last week.</a></p>
<p><a title="excel podcasts" href="http://www.blog.methodsinexcel.co.uk/2009/11/22/excel-podcasts-exciting-times/" target="_blank">One result of that is this podcast on spreadsheet development.</a></p>
<p>As far as I can remember we talk about</p>
<ul>
<li>Brief chat about some of Codematics products and services</li>
<li>Some of the technical issues around various add-in technologies</li>
<li>Plenty of chat about .net and xlls and VSTA/VSTO</li>
<li>We also talk about security/ intellectual property</li>
<li>There is a bit of chat about the business of independent software development</li>
<li>And of course a bit of a natter about Linux and Open Office</li>
<li>And some other stuff I can&#8217;t remember.</li>
</ul>
<p>The main thing I do remember is I did a reverse google. When talking about the <a title="classic ribbon tab" href="http://www.codematic.net/excel-tools/Excel-2007-classic-menu-tab-1.htm" target="_blank">Classic UI codematic offer</a> I said it was all written in XLM. Slight dyslexic slip of the tongue because I have been doing a bit to much macro mischief recently. What I should have said is there is a version that has no macros or VBA and is pure custom XML. Handy for those &#8216;under the radar&#8217; uses as there is no install and no trace.</p>
<p>It runs for about half an hour, feel free to leave your comments over at MIE or here.</p>
<p>cheers</p>
<p>Simon</p>
<p>&#160;</p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Meine erste "Software"...]]></title>
<link>http://codingbs.wordpress.com/2009/11/22/meine-erste-software/</link>
<pubDate>Sun, 22 Nov 2009 15:16:52 +0000</pubDate>
<dc:creator>teddya4</dc:creator>
<guid>http://codingbs.wordpress.com/2009/11/22/meine-erste-software/</guid>
<description><![CDATA[Im Rahmen meiner Ausbildung saß ich lange an der Entwicklung eines Makros&#8230;jetzt habe ich es en]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Im Rahmen meiner Ausbildung saß ich lange an der Entwicklung eines Makros&#8230;jetzt habe ich es endlich geschafft: Version 1.0 ist fertiggestellt und wird wahrscheinlich morgen am 23.11.2009 released.</strong></p>
<p>Das erste Projekt in meiner Ausbildung. Ein Makro, durch das die Berichtshefte automatisiert aus den Exporten unserer Zeitabrechnung generiert. Die erste &#8220;Software&#8221; die ich von vorne bis hinten entwickelt habe. Es ist schon irgenwie ein tolles Gefühl es endlich geschafft zu haben. Angefangen habe ich im September dieses Jahres. Und jetzt im November bin ich endlich fertig. Und morgen steht das Release an. Ein wenig aufgeregt bin ich schon; auf die Reaktion der anderen Azubis, denen durch das Makro eine Menge Arbeit erspart bleibt. Und sicherlich wird auch noch der ein oder andere Fehler entdeckt werden.</p>
<p>Es ist mein erstes Projekt. Meine erste selbst erstellte &#8220;Software&#8221;. Mein erster Kontakt mit VBA. Oft habe ich mir den Kopf zermatert, da irgendetwas nicht so funktioniert hat, wie ich es dachte. Eben habe ich noch die letzten Bugs gefixt, die mir auffielen. Auch mit der Testphase bin ich soweit durch. Fehler konnte ich keine mehr entdecken. Ich hoffe, dass das auch so bleibt.</p>
<p>Version 1.0 ist startklar für den Dauereinsatz <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[VBA-M, un emulador de GBA para GNU/Linux]]></title>
<link>http://mirutalibre.wordpress.com/2009/11/20/vba-m-un-emulador-de-gba-para-gnulinux/</link>
<pubDate>Sat, 21 Nov 2009 00:21:05 +0000</pubDate>
<dc:creator>zuargo</dc:creator>
<guid>http://mirutalibre.wordpress.com/2009/11/20/vba-m-un-emulador-de-gba-para-gnulinux/</guid>
<description><![CDATA[Si eres de los jugones y que más encima te gustan las consolas de Nintendo, de seguro conoces Visual]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;"><a href="http://mirutalibre.wordpress.com/files/2009/11/gba.png"><img class="alignright size-full wp-image-664" title="gba" src="http://mirutalibre.wordpress.com/files/2009/11/gba.png" alt="" width="128" height="128" /></a>Si eres de los jugones y que más encima te gustan las consolas de Nintendo, de seguro conoces <a href="http://vba.ngemu.com/" target="_blank">VisualBoyAdvance</a> un emulador para GBA que se encuentra disponible para GNU/Linux entre otros. Como sabrás VBA está abandonado hace un buen tiempo, es por ello, que nace <strong><a href="http://vba-m.com/" target="_blank">VBA-M</a></strong>, con el objetivo de mejorar VisualBoyAdvance<a href="http://sourceforge.net/projects/vbam/" target="_blank"><sup>[1]</sup></a> y retomar la emulación de la GBA en nuestros computadores.</p>
<p style="text-align:justify;">El proyecto aún está en pañales (y la verdad, desde septiembre de 2009, no lo han actualizado mucho), sin embargo, se supone, ofrece una mejor emulación de roms de GBA en comparación a VBA puesto que está basado en ese último y ya se le han agregado varias modificaciones.</p>
<p style="text-align:justify;">Si quieres probar <strong>VBA-M</strong> puedes descargar un<em> SVN build</em> desde la página oficial de <a href="http://vba-m.com/index.php?ind=downloads&#38;op=section_view&#38;idev=3" target="_blank">descargas</a> empaquetado para debian (.deb) o distros derivadas. Aún no se ha lanzado alguna versión del emulador, es por ello, que sólo están disponibles a fecha de hoy (20 de Noviembre de 2009) dichos <em>SVN build</em>.</p>
<p style="text-align:justify;">Sin embargo, te recomiendo instalar la versión <em>SVN</em> y actualizarla cuando se informe en la <a href="http://sourceforge.net/projects/vbam/" target="_blank">página de VBA-M en SourceForge</a>, que una nueva revisión ha sido lanzada. Puedes encontrar más información al respecto <a href="http://sourceforge.net/projects/vbam/develop" target="_blank">aquí</a>.</p>
<p style="text-align:justify;">Si usas <strong><a href="http://archlinux.org" target="_blank">Archlinux</a></strong>, estás de suerte, porque existe en el <strong><a href="http://aur.archlinux.org/" target="_blank">AUR</a></strong> un <strong><a href="http://aur.archlinux.org/packages.php?ID=16851" target="_blank">PKGBUILD</a></strong> para instalar la versión<em> SVN</em> del programa. Si usas <strong><a href="http://archlinux.fr/yaourt-en" target="_blank">yaourt</a></strong> no es más trabajo que:</p>
<p style="text-align:justify;"><code>$ yaourt -S ﻿﻿vba-m-gtk-svn</code></p>
<p style="text-align:justify;">Recuerda que para actualizar la aplicación a una nueva revisión, sólo debes generar y luego instalar el paquete <strong>.pkg.tar.gz</strong> correspondiente, con el mismo comando antes usado.</p>
<p style="text-align:justify;">Página de <a href="http://sourceforge.net/projects/vbam/" target="_blank"><strong>VBA-M</strong> en SourceForge</a></p>
<p style="text-align:justify;">Sitio <a href="http://vba-m.com/" target="_blank">web oficial de <strong>VBA-M</strong></a></p>
<p style="text-align:justify;">Otro <a href="http://forums.ngemu.com/vba-m-discussion/" target="_blank">sitio web</a>, al parecer oficial pero en desuso</p>
<p style="text-align:justify;">Saludos.</p>
<p style="text-align:justify;"><a href="http://sourceforge.net/projects/vbam/" target="_blank"><sup>[1]</sup>SourceForge: <strong>VBA-M</strong></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Excel VBA programming pt 3]]></title>
<link>http://daveroberts69.wordpress.com/2009/11/20/excel-vba-programming-pt-3/</link>
<pubDate>Fri, 20 Nov 2009 21:08:27 +0000</pubDate>
<dc:creator>daveroberts69</dc:creator>
<guid>http://daveroberts69.wordpress.com/2009/11/20/excel-vba-programming-pt-3/</guid>
<description><![CDATA[To examine a macro Tools/macro/visual basic editor In the VBE window find the window called project.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>To examine a macro<br />
Tools/macro/visual basic editor<br />
In the VBE window find the window called project.<br />
The project explorer contains a list of all workbooks.<br />
If there is a macro there click on the + sign.</p>
<p>To remove a macro<br />
Right click the macro.<br />
Click remove&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Excel VBA programming pt 2]]></title>
<link>http://daveroberts69.wordpress.com/2009/11/20/excel-vba-programming-pt-2/</link>
<pubDate>Fri, 20 Nov 2009 17:36:18 +0000</pubDate>
<dc:creator>daveroberts69</dc:creator>
<guid>http://daveroberts69.wordpress.com/2009/11/20/excel-vba-programming-pt-2/</guid>
<description><![CDATA[To record a simple macro. Macro is what this process is called. Select a range of cells that contain]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>To record a simple macro. Macro is what this process is called.<br />
Select a range of cells that contain formulas.<br />
Tools/macro/record new macro<br />
name the macro.<br />
Enter a short cut key combo.<br />
Click ok.<br />
Edit/copy<br />
Edit/paste special<br />
Select the values option<br />
Click ok<br />
Press escape.<br />
Tools/macro/stop recording</p>
<p>When you press the same short cut key combo it will perform the macro. A word of warning make sure the combo is not used by excel for something.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Excel VBA programming pt 1]]></title>
<link>http://daveroberts69.wordpress.com/2009/11/20/excel-vba-programming-pt-1/</link>
<pubDate>Fri, 20 Nov 2009 16:52:58 +0000</pubDate>
<dc:creator>daveroberts69</dc:creator>
<guid>http://daveroberts69.wordpress.com/2009/11/20/excel-vba-programming-pt-1/</guid>
<description><![CDATA[VBA stands for Visual Basic for Applications and can be used with all the 2007 ms office even visio.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>VBA stands for Visual Basic for Applications and can be used with all the 2007 ms office even visio. The VB editor is not installed with excel by default so you have to click on the developer tab &#38; select it from the group of add in programs. VBA allows you to perform several procedures by typing a shortcut on the keyboard.<br />
Imagine a sales manager having to all the sales figures for his salesmen maybe several times a week. He can do all that using one shortcut using VBA. There is 2 methods of using the VBA editor one is to record keystrokes and mouseclicks which produces VBA in the editor as you are doing it the other is to actually write the VBA &#38; edit it.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Batch File Controller - part 2]]></title>
<link>http://roymacleanvba.wordpress.com/2009/11/20/batch-file-controller-part-2/</link>
<pubDate>Fri, 20 Nov 2009 16:41:30 +0000</pubDate>
<dc:creator>Roy MacLean</dc:creator>
<guid>http://roymacleanvba.wordpress.com/2009/11/20/batch-file-controller-part-2/</guid>
<description><![CDATA[In the previous post, I was wondering how to run .bat files from VBA. This is in order to give me a ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In the <a href="http://roymacleanvba.wordpress.com/2009/11/17/batch-file-controller/">previous post</a>, I was wondering how to run .bat files from VBA. This is in order to give me a bit of a front-end, with a list of the available commands, with comments, and a Run button:</p>
<p><a href="http://roymacleanvba.wordpress.com/files/2009/11/batcontrol.png"><img class="alignnone size-full wp-image-291" title="Batcontrol" src="http://roymacleanvba.wordpress.com/files/2009/11/batcontrol.png" alt="" width="500" height="189" /></a></p>
<p>The key operation is the procedure <em>VBA.Interaction.Shell</em>. This takes a path to the executable file, plus an optional window mode (default is minimized with focus). The file name is picked up from the current selection (in column A), and the location is assumed to be that of the workbook. Obviously, you could get fancier than this, maybe with a form.</p>
<pre style="font-family:Courier;font-size:10pt;">    batdir = ActiveWorkbook.Path
    ChDir batdir
    batfile = "dir.bat"
    batpath = batdir + "\" + batfile
    taskid = Shell(batpath)</pre>
<p>The Shell procedure returns a taskid, if successful.</p>
<p>The batch commands produce lots of verbose output, which is written to a text file &#8220;out.txt&#8221; in the working directory. It might or might not contain ERROR lines, so it would be useful to have these detected. The call to <em>Shell </em>is therefore followed by a call to a procedure that checks the output file:</p>
<pre style="font-family:Courier;font-size:10pt;">Sub ErrorCheck()
    Dim fso As New Scripting.FileSystemObject
    Dim f As Scripting.File
    Dim ts As Scripting.TextStream
    Dim line As String

    Set f = fso.GetFile(outfile)
    Set ts = f.OpenAsTextStream

    Dim founderror As Boolean
    line = ts.ReadLine
    founderror = CheckLine(line)
    Do Until ts.AtEndOfStream Or founderror
        line = ts.ReadLine
        founderror = CheckLine(line)
    Loop

    If founderror Then
        MsgBox "Error: " + vbCrLf + line
    Else
        MsgBox "Command " &#38; batfile &#38; " successful"
    End If
End Sub</pre>
<p>This uses the <em>FileSystemObject</em>, <em>File </em>and <em>TextStream </em>classes from the MS Scripting Runtime Library (find this in the &#62;Tools &#62;References dialog).</p>
<p>However, there&#8217;s a problem: a batch command can take several seconds to run, so I want to pause the VBA execution until it finishes, otherwise <em>ErrorCheck </em>won&#8217;t get access to the output file.</p>
<p>The trick is to use the task id returned by <em>Shell</em>, to get a process handle for the running command, and then check the process&#8217;s status repeatedly until it exits. The functions required are Windows functions, not VBA: <em>OpenProcess </em>and <em>GetExitCodeProcess</em>. The standard code to use these is wrapped up in a procedure called <em>RunAppWait</em>. It is this that we call from our code, instead of calling <em>Shell </em>directly.</p>
<p>You can find more information on this on MSDN: <a href="http://msdn.microsoft.com/en-us/library/dd789432.aspx">Running Other Applications from Access 2007</a>. (There&#8217;s nothing Access-specific in this stuff). The modules can be downloaded via the first link at the end of the article.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Should we care about the Clients Environment?]]></title>
<link>http://smurfonspreadsheets.wordpress.com/2009/11/20/should-we-care-about-the-clients-environment/</link>
<pubDate>Fri, 20 Nov 2009 08:04:25 +0000</pubDate>
<dc:creator>Simon</dc:creator>
<guid>http://smurfonspreadsheets.wordpress.com/2009/11/20/should-we-care-about-the-clients-environment/</guid>
<description><![CDATA[Dennis made an interesting comment on a previous thread about how as developers we should be making ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Dennis made an interesting comment on a previous thread about how as developers we should be making use of multiple virtual machine technology to mimic our clients&#8217; environments so we can better support them.</p>
<p><a href="http://smurfonspreadsheets.wordpress.com/files/2009/11/netwiz.jpg"><img class="aligncenter size-full wp-image-1904" title="netwiz" src="http://smurfonspreadsheets.wordpress.com/files/2009/11/netwiz.jpg" alt="" width="297" height="168" /></a></p>
<p>Its a good point&#8230; but I completely disagree.</p>
<p>Some developers should do that for sure, what Microsoft calls &#8216;professional&#8217; developers perhaps. I prefer to think of Excel/VBA developers as business developers, we are a bit closer to the business and a bit further away from the bits and bytes of hardcore coding.</p>
<p>We express our business knowledge in Excel and VBA for a variety of reasons. One vital one for me though is ease of deployment and hence support.</p>
<p>If I write a decent spreadsheet in Excel 2000, I can reasonably expect it to work perfectly in Excel 2000, 2002, and 2003. I can expect it to work at least partially in 2007. That is irrespective of the wider target environment, user rights, security credentials, previous installed components, corporate build oddities etc etc. There is no dll hell in Excel*.</p>
<p>If the client has Excel they can run my application. full stop, end of.</p>
<p>(Of course there is a little excitement about macro security, the way they messed up expired signatures, the fact no one uses them because they are such a blatant scam etc)</p>
<p>*(ok so we sometimes get cannot find project or library, but if we keep things close to Excel/VBA and develop with care, and with some consideration for the clients environment that doesn&#8217;t happen much, and can usually be easily fixed.)</p>
<p>This trivial deployment leaves us business developers free to invest our time in understanding the business better and improving our software development skills. Deployment skills? system admin/security skills? heard of them, don&#8217;t want them or need them.</p>
<p>This is one of the biggest reasons I have not focused on .net &#8211; its a deployment nightmare. Of course that&#8217;s solvable, just invest a bunch of time and effort learning sys admin stuff and security stuff, and a bit of virtual machine trickery and jobs a good&#8217;un. But I don&#8217;t want to do that, I want to improve my business knowledge and my coding skillz. Luckily Microsoft cater for folks like me with Excel VBA.</p>
<p>Don&#8217;t get me wrong .net works well for corporate developers (once they have the required sys admin knowledge) but for independent devs like me, there is way too much pain to trawl through to distribute and support custom built .net components.</p>
<p>So I care a little bit about my clients environment, but not much. And frankly I think the fact that developers have to spend time and effort creating such close replicas of a clients environment is a hugh fail for Windows software development and for Microsoft. &#8216;Write once deploy everywhere&#8217; &#8211; in yer dreams!</p>
<p>Major service packs? fair enough.  When you need to remotely replicate their level of hotfixes across a broad swathe of operating system components and applications the process is seriously broken IMO.</p>
<p>When I did asp development I had to get intimate with IIS to be able to work out when things went wrong whether it was our code or the server environment. If my Excel apps goes wrong, it&#8217;s my code, no investigation required (roughly).</p>
<p>I don&#8217;t have anything against .net, there is much about it I like, I just don&#8217;t think its aimed at pragmatic delivery focused independent desktop developers (like me). (Hence for the observant, the pic is from .net 1.1 from 2003). I jump at any chances I get to develop in C#, the joy of a modern language and a modern IDE, but this tends to be when I am contracted on-site in the role of corporate dev, rather than independent software developer.</p>
<p>What about you? do you find distributing your .net apps a true joy, the real highlight of your dev cycle?</p>
<p>Are you juggling more than 10 virtual machines, and keeping the patching in step with clients?</p>
<p>Which do you prefer development or deployment?</p>
<p>Do you agree with the separate roles of corp dev and business dev?</p>
<p>Cheers</p>
<p>Simon</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How did you learn VBA?]]></title>
<link>http://smurfonspreadsheets.wordpress.com/2009/11/19/how-did-you-learn-vba/</link>
<pubDate>Thu, 19 Nov 2009 10:04:10 +0000</pubDate>
<dc:creator>Simon</dc:creator>
<guid>http://smurfonspreadsheets.wordpress.com/2009/11/19/how-did-you-learn-vba/</guid>
<description><![CDATA[Dick has a post over at DDOE about encouraging people to have a go at VBA. I completely agree, and i]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="have a go at VBA" href="http://www.dailydoseofexcel.com/archives/2009/11/18/learn-vba-to-be-lean/" target="_blank">Dick has a post over at DDOE about encouraging people to have a go at VBA</a>.</p>
<p>I completely agree, and in the spirit of “Recruit a new VBA programmer” week, I would like to hear how you got started in VBA.</p>
<ul>
<li>What books did you use?</li>
<li>What courses did you attend?</li>
<li>Did you have an on-site expert to help?</li>
<li>Did you use MS help?(could you find it?)</li>
<li>When, and which version did you learn on?</li>
<li>Maybe you havent learnt, in which case do you have a plan?</li>
<li>If you have no plans to learn VBA, why not?</li>
<li>oh, and why did you learn VBA?</li>
</ul>
<p>Me:</p>
<p>I learnt VBA in Excel 5.0 when it was first introduced (1995?). I had already done some XLM, VBA was a BIG change.</p>
<p>I used some deadly dull teach yersen in 21 days type book initially. Then I spent about 10 years with the help constantly open. Then t&#8217;intawebs happened and I now go to Google first help second. Can&#8217;t remember when we got broadband but even MS help is better than a dial up to Google.</p>
<p>I learnt VBA to escape the monotony of management accounting, after 30 odd period ends I was truly sick of the same accruals and prepayments the day before, and the same sales, gross profit reports after.</p>
<p>At one place I worked my colleagues were concerned that my desk was full of technical books &#8216;you&#8217;re meant to be the expert&#8217; they said. Accepting that you don&#8217;t already know everything is perhaps the first step to becoming an expert.</p>
<p>I have never been on a VBA course, although I have now taught plenty. Never had an on-site expert I could bounce ideas off, although more recently I have often been in a team of multiple devs which is great.</p>
<p>My most recommended VBA book would be <a href="http://www.amazon.co.uk/gp/product/0764574124?ie=UTF8&#38;tag=smurfo-21&#38;linkCode=as2&#38;camp=1634&#38;creative=19450&#38;creativeASIN=0764574124">Excel VBA Programming for Dummies</a><img class="qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.co.uk/e/ir?t=smurfo-21&#38;l=as2&#38;o=2&#38;a=0764574124" border="0" alt="" width="1" height="1" /></p>
<p>Mainly because it dives right in there with real world useful stuff without boring you to tears with anal levels of background/foundations.</p>
<p>I guess this is the latest version for all you ribbon lovers <a href="http://www.amazon.co.uk/gp/product/0470046740?ie=UTF8&#38;tag=smurfo-21&#38;linkCode=as2&#38;camp=1634&#38;creative=19450&#38;creativeASIN=0470046740">Excel 2007 VBA Programming for Dummies</a><img class="qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao qyiyylyixuslamqepaao" style="border:none!important;margin:0!important;" src="http://www.assoc-amazon.co.uk/e/ir?t=smurfo-21&#38;l=as2&#38;o=2&#38;a=0470046740" border="0" alt="" width="1" height="1" />.</p>
<p>If after that you think VBA is something you want to persue further, then is the time to dredge through all that tedium about datatypes etc. We&#8217;ll cover that &#8216;next steps&#8217; in another post later.</p>
<p>What about you?</p>
<p>Cheers</p>
<p>Simon</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Processing speed]]></title>
<link>http://smurfonspreadsheets.wordpress.com/2009/11/18/processing-speed/</link>
<pubDate>Wed, 18 Nov 2009 00:34:44 +0000</pubDate>
<dc:creator>Simon</dc:creator>
<guid>http://smurfonspreadsheets.wordpress.com/2009/11/18/processing-speed/</guid>
<description><![CDATA[John Walkenbach has a post comparing peoples processor speed here. If you havent added yours please ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="JW sys speed" href="http://spreadsheetpage.com/index.php/comments/how_fast_is_your_system/#c" target="_blank">John Walkenbach has a post comparing peoples processor speed here</a>. If you havent added yours please do so, especially if you have a monster machine.</p>
<p>I duly did the tests and posted my results. Mathius did the equiv code in C#, so of course I had to fire up C++. It ran in about 2.7 seconds compared to 13.7 in VBA. No surprises there right?</p>
<p>So then I fired up my beloved VB6 &#8211; <strong>19 Seconds!</strong> WTF??? I did all the optimisations and got it back down to 15.something. But why would a VB6 exe be so much slower than VBA?</p>
<p>If you have VB6 perhaps you could run your own check in case I&#8217;m doing something dumb. It took me ages to realise/remember that VB6 doesn&#8217;t have separate debug and release builds (too long in VC++)</p>
<p>Double bizzaro, if I debug in VB6 i get 13.odd, if I build the exe and double click that I get 15 or so.</p>
<p>Why would the compiled version be slower than the debug version?</p>
<p>I tried it as a dll too and VBA is still faster.</p>
<p>I know recent VBAs use slightly different libraries, but I thought they all went through the same MSVBVM60 runtime? Maybe this test doesn&#8217;t need that runtime from VBA?</p>
<p>I don&#8217;t want to spend much time on this, VB6 is pretty much an ex-parrot at this stage, but anyone has a plausible answer off the top of their head please leave a comment.</p>
<p>cheers</p>
<p>Simon</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Batch File Controller]]></title>
<link>http://roymacleanvba.wordpress.com/2009/11/17/batch-file-controller/</link>
<pubDate>Tue, 17 Nov 2009 12:53:28 +0000</pubDate>
<dc:creator>Roy MacLean</dc:creator>
<guid>http://roymacleanvba.wordpress.com/2009/11/17/batch-file-controller/</guid>
<description><![CDATA[I&#8217;ve recently been getting involved with the DITA documentation framework. There are various f]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;ve recently been getting involved with the <a href="http://roymacleanvba.wordpress.com/2009/08/25/digression-on-documentation-dita/">DITA documentation framework</a>. There are various free (or free for personal use) tools to support it, but they are often command-line tools. Fancy user interfaces cost!</p>
<p>The <a href="http://www.xmlmind.com/ditac/">tool that converts DITA XML to XHTML, PDF, etc</a>, is such a command-line tool, with lots of options to control its behaviour. You have to specify an input map (a build manifest), and an output target. From my content base, I want to build different outputs, in different formats. So I am accumulating a folder full of .bat files, each containing a particular command, with options and file parameters. Running a bat file, in verbose mode, generates a few screen-fulls of output messages, which might or might not contain error messages.</p>
<p>So what I&#8217;d like is a simple front end that allows me to select a particular combination of content and format, run the command, and check the output for errors. Since I&#8217;ll want a list of the available bat files, and a bit of user interaction, I&#8217;ll do it in Excel (more as a vehicle than because I need many of Excel&#8217;s capabilities).</p>
<p>The key is the <em>VBA.Interaction.Shell</em> method. Details tomorrow.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Nhập đường dẫn 1 file ảnh vào chương trình để lưu!]]></title>
<link>http://thuthuataccess.wordpress.com/2009/11/14/nh%e1%ba%adp-d%c6%b0%e1%bb%9dng-d%e1%ba%abn-1-file-%e1%ba%a3nh-vao-ch%c6%b0%c6%a1ng-trinh-d%e1%bb%83-l%c6%b0u/</link>
<pubDate>Sat, 14 Nov 2009 18:35:00 +0000</pubDate>
<dc:creator>Noname</dc:creator>
<guid>http://thuthuataccess.wordpress.com/2009/11/14/nh%e1%ba%adp-d%c6%b0%e1%bb%9dng-d%e1%ba%abn-1-file-%e1%ba%a3nh-vao-ch%c6%b0%c6%a1ng-trinh-d%e1%bb%83-l%c6%b0u/</guid>
<description><![CDATA[Hôm trước tôi có nêu thủ thuật Insert 1 ảnh vào form/report khi đã có đường dẫn ảnh. Hôm nay tôi sẽ ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hôm trước tôi có nêu thủ thuật Insert 1 ảnh vào form/report khi đã có đường dẫn ảnh.</p>
<p>Hôm nay tôi sẽ giới thiệu các bạn cách để nhập liệu đường dẫn ấy sao cho người dùng chỉ cần click chuột.<br />Trên form, bạn vẽ 1 textbox đặt tên là txtpicture, một nút nhấn tên cmdInsertPic,1 đối tượng ảnh đặt tên là image<br />bạn phải tạo 1 funtcion để lấy về đường dẫn file ảnh</p>
<p><a name='more'></a><br />Code:<br />
<blockquote>Function getFile(Tit As String, formatName As String, formatType As String)<br />Dim dlgOpen As FileDialog<br />Set dlgOpen = Application.FileDialog(msoFileDialogOpen)<br />With dlgOpen<br />.Title = Tit<br />.Filters.Clear<br />.Filters.Add formatName, formatType<br />.AllowMultiSelect = False<br />result = .Show<br />If (result &#60;&#62; 0) Then<br />getFile = Trim(dlgOpen.SelectedItems.Item(1))<br />End If<br />End With</p>
<p>End Function</p>
</blockquote>
<p>Bây giờ trong hành động click của nút nhấn, ta nhập đoạn code sau:</p>
<p>Code:</p>
<blockquote><p>Me![TxtPic] = GetFile_CLT(&#8220;c:\&#8221;, &#8220;Select the Picture File&#8221;,&#8221;*.jpg&#124;*.bmp&#8221;)<br />Me![TxtPic] = LCase(Me![TxtPic])<br />Me![Image].Picture = Me!TxtPic</p>
</blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[In hình ảnh khi có đường dẫn hình]]></title>
<link>http://thuthuataccess.wordpress.com/2009/11/14/in-hi%cc%80nh-a%cc%89nh-khi-co%cc%81-d%c6%b0%c6%a1%cc%80ng-da%cc%83n-hi%cc%80nh/</link>
<pubDate>Sat, 14 Nov 2009 18:20:00 +0000</pubDate>
<dc:creator>Noname</dc:creator>
<guid>http://thuthuataccess.wordpress.com/2009/11/14/in-hi%cc%80nh-a%cc%89nh-khi-co%cc%81-d%c6%b0%c6%a1%cc%80ng-da%cc%83n-hi%cc%80nh/</guid>
<description><![CDATA[Hỏi: Tôi đã lưu hình ảnh vào ổ đĩa G: ( G: là ổ đĩa mạng). Và có 1 cơ sở dữ liệu lưu đường dẫn theo ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><b>Hỏi:</b> Tôi đã lưu hình ảnh vào ổ đĩa G: ( G: là ổ đĩa mạng). Và có 1 cơ sở dữ liệu lưu đường dẫn theo dạng : tvhinh(mahang,txtpic). Bây giờ trong Report làm sao tôi có thể vẽ lại các hình tôi đã lưu!<br /><b>Đáp:</b><br />Trong Report, bạn vẽ 1 textbox đặt tên là txtpic, đặt thuộc tính visible của nó là False.<br />Vẽ 1 đối tượng image đặt tên nó là image1<br />Sau đó cho đoạn code sau vào</p>
<p><a name='more'></a></p>
<blockquote><div class="MsoNormal"><b>Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)</b></div>
<div class="MsoNormal"><b>On Error GoTo err_Pic</b></div>
<div class="MsoNormal"><b>If IsNull(Me.txtPic) Then</b></div>
<div class="MsoNormal"><b>&#160;&#160;&#160; Me.Image1.Picture = &#8220;&#8221;</b></div>
<div class="MsoNormal"><b>&#160;&#160;&#160; Me.Image1.Visible = False</b></div>
<div class="MsoNormal"><b>Else</b></div>
<div class="MsoNormal"><b>&#160;&#160;&#160; Me.Image1.Picture = txtPic.Value</b></div>
<div class="MsoNormal"><b>&#160;&#160;&#160; Me.Image1.Visible = True</b></div>
<div class="MsoNormal"><b>End If</b></div>
<div class="MsoNormal"><b>Exit Sub</b></div>
<div class="MsoNormal"><b>err_Pic:</b></div>
<div class="MsoNormal"><b>&#160;&#160;&#160; MsgBox Err.Description, vbOKOnly</b></div>
<div class="MsoNormal"><b>&#160;&#160;&#160; Exit Sub</b></div>
<div class="MsoNormal"><b>End Sub</b></div>
</blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Tạo một đường viền cho report]]></title>
<link>http://thuthuataccess.wordpress.com/2009/11/14/t%e1%ba%a1o-m%e1%bb%99t-d%c6%b0%e1%bb%9dng-vi%e1%bb%81n-cho-report/</link>
<pubDate>Sat, 14 Nov 2009 18:15:00 +0000</pubDate>
<dc:creator>Noname</dc:creator>
<guid>http://thuthuataccess.wordpress.com/2009/11/14/t%e1%ba%a1o-m%e1%bb%99t-d%c6%b0%e1%bb%9dng-vi%e1%bb%81n-cho-report/</guid>
<description><![CDATA[Tôi muốn tạo một đường viền cho report giống như boder style của word&nbsp;khi in mà kô phải mất côn]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Tôi muốn tạo một đường viền cho report giống như boder style của word&#160;khi in mà kô phải mất công kẻ bằng tay được ko?</p>
<p><b>Đáp:</b> <br />Cho đoạn code sau vào report! <br />
<blockquote>Private Sub Report_Page()<br />&#160;&#160;&#160;&#160;&#160;&#160; On Error Resume Next<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Me.DrawWidth = 6&#160;&#160; &#8216; do rong duong line<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Me.DrawStyle = 0&#160;&#160; &#8216; 0 den 6 =&#62; kieu duong mat dan<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216; Sử dụng công thức object.Line (x1, y1) &#8211; (x2,y2), color, [Box=B]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), vbred, B<br />&#160;&#160;&#160;&#160;&#160;&#160; End Sub</p></blockquote>
</div>]]></content:encoded>
</item>

</channel>
</rss>
