Saturday, May 11, 2013

VBA and Google Apps Script Side-By-Side

Appendix A, provisionally entitled  "Appendix A: Excel VBA And Google Apps Script Comparison"
has been added to my book Google Spreadsheet Programming

Download the free sample which includes the appendix covering common spreadsheet programming tasks in both VBA and Google Apps Script.

Please send me any comments or suggestions that you have so that I can add to and improve the material it contains.  More content will be added in due time.

Some Notes On Google Apps Scripts and VBA

The most common type of request that I receive from readers is how to translate Excel VBA into Google Apps Script.  Google Spreadsheets implements most of the standard spreadsheet functions in addition to a few of its own.  However, from a programming perspective Excel and Google Spreadsheets are quite different:

  • VBA is the last survivor of the old pre-VB.NET VB lineage with the main branch ending at VB6.  Google Apps Script is a JavaScript dialect with a very different syntax and philosophy from VBA.  Use of semi-colons to end statements, curly braces to delimit code blocks, and case sensitivity are just a few of the more obvious ways in which Google Apps Script differs from VBA.
  • Google Apps Script, being a JavaScript dialect, comes with some really useful productivity enhancers such as functions as first class objects, very flexible data structures in the form of its arrays and objects, and built-in regular expressions.  See Douglas Crockford's very well-known O'Reilly title JavaScript The Good Parts for all the details.

However, both languages are hosted within applications and are used as the "glue" to integrate applications.  Their APIs are therefore quite similar in philosophy if not in detail.

Check out the PDF and let me know what you think!

Update 22-May-2013
I'm getting positive feedback on this blog entry so there is clearly some interest in this. Accordingly, I will continue to update the PDF with additional code examples.  Suggestions or examples are also very welcome!


  1. If you learn Dart, and don't learn JavaScript, will you be able to understand Google Apps Script? Thanks.

    1. This comment has been removed by a blog administrator.

  2. Hi Jeff, I know very little about Dart and I don't know if it will have any direct bearing on Google Apps Script (GAS). However, GAS is really just JavaScript so, regardless of what Dart turns out to be, learning GAS means learning JavaScript.

    Hope that helps


  3. Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
    Webdesining course in chennai

  4. I ask your absolve? That should be English, on the off chance that you were pondering! Also, NO, we didn't specialist this in any capacity! Likewise, on the off chance that anybody can reveal to us what "flinders" are, at that point they know more Middle English than we do!tts reader

  5. The text to speech software you thin down on ought underpins English, yet other elective dialects, situating it as a reasonable tool for amateur etymologists, online text to voice converter

  6. Absolutely fantastic posting! Lots of useful information and inspiration, both of which we all need!Relay appreciate your work. Buy Google Reviews,

  7. Learn Excel Basic to Adv. Level with 100% Placement offer. Luxury Lab, 10+ Years Experienced Trainer, Online & Classroom Both Training Available. Contact Number-+91-9311002620.

    There are Some Best Training Center for Advanced Excel regarding

    Advanced excel training institute in Delhi
    Advanced excel training institute in Noida