Monday, 5 August 2013

VBA Modules: I've started a new blog

EDIT: left the background info up but have moved all my code posts into a new separate code blog

Original post and info follows:

As a bit of personal background, I've been developing in VBA automation since 2009, with about 3 years of moderate Excel & Access VBA development behind that, so the majority of the code is designed with Excel automation in mind, but does make use of Access and Outlook VBA where needed.  I've never had to automate Powerpoint or other MS apps but I'm sure I will eventually.

I work for a globocorp, and all the network addresses you will see here are completely inaccessible to anyone outside the company, so just change them for your own file locations.

Please note that I make no claims to copyright as all my code is open source, largely stolen, copied, or adapted from other snippets of code I've found via Google, usually with the original source link included for reference and polite attribution.  I've never had any formal VBA training, so this is all picked up from the interweb, and adapted for my own needs, using my own fair hands.  Feel free to steal, copy or adapt my code for your own needs -- that's what I did!

The modules I'll post here are interlinked (so you'd need to "install" the whole series to get full functionality and stop errors with Debug > Compile) but they do largely work as standalone modules.  I've annotated which modules are dependent on which, so it's easy to see that for yourself.

I've been loathe to post these modules online because they're never, ever "finished", as I keep adding new features as and when I need them.  But, in a stroke of momentary genius a while ago, I started version-numbering the macros to keep track of the various changes, and I've recently started keeping a Version History in all modules, so I reckon I can now keep my blog up-to-date with changes.  (We'll soon see!)  Plus, after migrating everything to a new server with Office 2010, I think I'm finally running out of necessary improvements to make.  It does just about everything I need it to.

However, I must be clear about this: this code is not for the faint-hearted.  I don't always put syntax or other descriptive details in the macros, so you'll need a fair bit of VBA knowledge under your belt to make sense of some of it.  But it should at least work... feel free to just try it out, and ask me questions if you're not sure about how anything works or what it does -- I'll improve the code annotations as I go along -- but if you're a VBA n00b, there are countless Excel / VBA forums with hundreds of members where you can get basic support, just as I did.  VBA has a pretty steep learning curve if you don't have the time to develop your skills gradually.  I had 5 years to develop mine.  Another guy I saw asking a complete n00b question on a forum ended up with his profile being marked as "Excel VBA MVP" within 3 years.  So before you jump from the high dive board, I'd strongly suggest you either pay for a professional VBA course, hire a spod to do it, or just think again and start in the shallow end.

First module here:

No comments: