Getting Started in VBA

My off-the-cuff recruit a new VBA programmer week comment got a modest amount of traction around the ‘tubes. Yet, I didn’t want to wait a whole year to provide these links. From msdn’s Getting Started with VBA… series.

Are you facing a repetitive clean up of fifty tables in Word 2010? Do you want a particular document to prompt the user for input when it opens? Are you having difficulty figuring out how to get your contacts from Microsoft Outlook 2010 into a Microsoft Excel 2010 spreadsheet efficiently?

You can perform these tasks and accomplish a great deal more by using VBA for Office 2010-a simple, but powerful programming language that you can use to extend Office 2010 applications.

Getting Started with VBA in Office 2010
Getting Started with VBA in Excel 2010
Getting Started with VBA in Outlook 2010
Getting Started with VBA in Powerpoint 2010

Links from John Durant, author of Why VBA Still Makes Sense.

Posted in Uncategorized

6 thoughts on “Getting Started in VBA

  1. While I like VBA, I’d prefer to develop my macros, user defined functions, etc. with C#
    I’m looking at C# 4.0 Optional Parameters as the Missing.Value piece of the puzzle. If you know what I mean…

  2. The current version of C# doesn’t have optional parameters, so if you want to call, say, Workbook.Open, you need to supply a value for every parameter, even if you dont intend to use them. You have to supply Missing.Value for each parameter placeholder.
    In order to reduce the parameter count, you’d need to write your own wrapper specific to each use of the method.

    Excel talks COM, so is nasty to program against with C#. I think it gets easier with VB.NET, but I haven’t had a go.
    COM has a big history, and to date .NET has been giving it the cold shoulder. PIAs exist (which btw I feel is an appropriate acronym) but it’s not the same development experience as with .NET.

    A couple of articules describing the change…

  3. The only reason why C# 4.0 is improved in this area is the fact that C# (and F#) is the preferred language at MSFT.

    For the native Office developer VB.NET is more of interest as it’s closer to VBA then what C# will ever be. Yes, VB.NET 10.0 comes with some great news as well. In VS 2010 the PIAs have been much improved and therefore is a less PIA for You ;)

    After spending the last 4-5 years with Excel & .NET I have to disagree. The keyword to work with Excel & .NET is knowledge and many developers have not taken the time to get it.

    Kind regards,

  4. Dennis: you’re probably right to disagree. I guess I’m showing my ignorance as I’m not exposed to the VB.NET side of the fence.
    I chose my language and stuck with it, and the two worlds I live in (C# and Excel) haven’t yet met in the way I want.

Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.