{"id":168,"date":"2007-06-21T22:10:01","date_gmt":"2007-06-21T22:10:01","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=168"},"modified":"2007-06-21T23:16:42","modified_gmt":"2007-06-21T23:16:42","slug":"programming-with-microsoft-money","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=168","title":{"rendered":"Programming with Microsoft Money"},"content":{"rendered":"<p>I&#8217;ve used <a href=\"http:\/\/www.microsoft.com\/money\/\" target=\"_blank\">Microsoft Money<\/a> for years &#8211; ever since I started using MS Money 97 at Uni. I can&#8217;t imagine how I&#8217;d keep on top of finances without it. <\/p>\n<p>The tricky bit is having to enter transactions into the software every time you buy something &#8211; something which lends itself perfectly to a mobile solution. Rather than waiting until you next get to your computer, enter the transaction immediately by jotting a quick note on your mobile. <\/p>\n<p>I bought a copy of <a href=\"http:\/\/www.spbsoftwarehouse.com\/products\/finance\/\" target=\"_blank\">Spb Finance<\/a>. It&#8217;s almost perfect&#8230;. except that the syncing between PDA and PC sucks<a href=\"http:\/\/dalelane.co.uk\/blog\/?p=168#spb\">*<\/a>. I&#8217;ve tried everything to get it to work &#8211; including working with the support guys at Spb, collecting trace and log files for them and multiple re-installs in different configurations. No joy &#8211; syncing is still unreliable, has corrupted my Money file a few times, and even when it works it has a habit of chewing up all remaining CPU cycles on the computer, making my ThinkPad run scarily hot. <\/p>\n<p>So I thought I&#8217;d have a go at writing something for myself. <\/p>\n<p><!--more--><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money1.gif\" alt=\"screenshot\" hspace=\"10\"\/> <img decoding=\"async\" hspace=\"10\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money2.gif\" alt=\"screenshot\" \/><\/p>\n<p>I don&#8217;t normally blog about every Windows Mobile app I throw together, mainly because it&#8217;s&#8230;. well, basically fairly trivial. Drag-and-drop programming. <\/p>\n<p>But this one was a bit interesting because of the data I wanted to collect. <\/p>\n<p>After some fruitless Googling, it seems that <strong>there is no API for getting at my Money data<\/strong>. This surprised me&#8230; after writing all sorts of bits of pieces using Internet Explorer, and a bunch of MS Office apps, in a variety of languages, I kinda assumed that Microsoft would have published an API for accessing the database behind MS Money. <\/p>\n<p>But apparently not. Spoilsports. \ud83d\ude41<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money3.gif\" hspace=\"5\" alt=\"screenshot\" align=\"left\"\/> So I&#8217;ve gone for a compromise &#8211; by <strong>creating Open Financial Exchange (OFX) files<\/strong>. OFX is a data-stream format for exchanging financial information. Typically, you download OFX files from your online banking service, and import it into Microsoft Money. But I don&#8217;t see any reason why I can&#8217;t use this to get my information into the app. <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money4.gif\" alt=\"screenshot\" align=\"right\"\/>I found the <a href=\"http:\/\/www.ofx.net\/ofx\/de_main.asp\" target=\"_blank\">specification for the format of OFX files<\/a> on the OFX website. Not the most user-friendly doc in the world, but the information is all in there to write an app which generates OFX statements. <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money5.gif\" vspace=\"15\" hspace=\"10\" alt=\"screenshot\" align=\"left\"\/><br \/>\nI don&#8217;t think it&#8217;s really meant for this sort of thing&#8230; it&#8217;s really meant for a more definitive statement of account transactions than as a way of importing user input. <\/p>\n<p>For example, the <strong>OFX specification requires the current balance<\/strong> at the time of the statement was generated. As I&#8217;m talking about doing a one-way sync of PDA to computer, I can&#8217;t really do this &#8211; so am just setting this to 0 and hoping it doesn&#8217;t cause MS Money any problems. <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money6.gif\" alt=\"screenshot\" align=\"right\" vspace=\"10\" hspace=\"10\" \/>The other issue is that the <strong>OFX spec doesn&#8217;t include categories<\/strong> &#8211; the bit that says how the money was spent, such as &#8220;Groceries&#8221; or &#8220;Gas bill&#8221;. On the plus side, this means one less box needed for my app. It saves a bit of data entry for each transaction, and frees up space to make all the other controls a bit bigger. <\/p>\n<p>And Microsoft Money does a neat job of guessing categories for transactions based on the shop name (e.g. transactions at &#8220;Esso&#8221; get prefilled with a category of &#8220;Petrol&#8221;). So it&#8217;s not all bad.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money7.gif\" alt=\"screenshot\" hspace=\"10\" vspace=\"10\"\/> <img decoding=\"async\" hspace=\"10\" vspace=\"10\" src=\"http:\/\/dalelane.co.uk\/database\/imagedata\/money8.gif\" alt=\"screenshot\" \/><\/p>\n<p>On the plus side, including the <strong>account number and sort code in the OFX file lets Microsoft Money match up transactions with the right account<\/strong> in MS Money. <\/p>\n<p>Other than that, it was just a job of creating an interface that minimises effort and doesn&#8217;t need a stylus (chunky date boxes that you can either tap on &#8211; tap on the top to roll it up, on the bottom to roll it down &#8211; or just use the D-Pad&#8230; big finger-jabbable on-screen number buttons when you tap on the value box&#8230; that sorta thing), and rejigging the buttons around if the screen is rotated.<\/p>\n<hr \/>\n<p><a name=\"spb\">*<\/a>  Oh &#8211; about SPB Finance&#8230; I should be fair. Although I can&#8217;t help being a little annoyed at paying money for software that I can&#8217;t actually use, it&#8217;s probably not entirely their fault. <\/p>\n<p>My money file is old &#8211; it&#8217;s been upgraded twice (from MS Money 97 to 2001, and then again to 2005), so who knows what random bits of crap got left in the file that don&#8217;t conform exactly to the current MS Money spec. <\/p>\n<p>And the file is big &#8211; it has all of my finance records since 1999. I don&#8217;t like to have to archive older stuff, because it&#8217;s just hassle. So maybe their solution just isn&#8217;t suited to trying to juggle a data source that big. For all I know, a new clean file that isn&#8217;t 20 megs in size might sync perfectly. <\/p>\n<p>As an aside&#8230; I wonder how SPB get their access to the MS Money database. Reverse engineering? Or do they just ask Microsoft nicely? \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve used Microsoft Money for years &#8211; ever since I started using MS Money 97 at Uni. I can&#8217;t imagine how I&#8217;d keep on top of finances without it. The tricky bit is having to enter transactions into the software every time you buy something &#8211; something which lends itself perfectly to a mobile solution. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=168"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/168\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}