VBA to JavaScript Translator

It’s been a while since my last post. I’ve been enthralled with updating a few of my books for Office 2016 and learning about the inner workings of Web Apps for Office.

For those of you who don’t know, the future of office programmability will be creating applications that work on all devices (desktops, phones, tablets, etc.). Microsoft is currently developing a host of web APIs that will essentially make up a new kind of web-based Object model in which developers can leverage to create web driven applications.

These “apps for Office” are NOT a replacement for VBA. So don’t go looney on me. VBA still has a home on client-side development. The new Web Apps paradigm is a way for us to be able enter a realm of development we’ve been missing out on (web development).

This will require us to jump into scary waters. We’ll have to get comfortable with JavaScript, XML, HTML and some of the other web languages that we just don’t deal with now.

This journey into web development will be a slow one for many of us. It will require think-time, practice, and training. It will be an uncomfortable, but worthwhile transition.

Don’t worry…it’s not something we need to deal with all at once. I’ll eventually do a series of posts on developing these Web Apps for Office. For now, I want to share a pet project that I’ve been toying with.

 

I’ve create a VBA to JavaScript translator; partly to help me get my mind around JavaScript, and partly as an educational tool for anyone interested in moving from VBA to JavaScript.

You can find this tool here

This tool is designed to translate the most common constructs in VBA to JavaScript.

The idea is to enter some familiar VBA code to see how you would write the same syntax in JavaScript.

 

I figure I’m about a year too early with this kind of tool, but who knows. Some of you may be looking to dip into JavaScript now.

By the way…on the tool’s web page, you will find a link to a Github page where all the source code is available. I’m hoping a few intrepid souls are willing to help enhance the tool to make it more robust.

I’ll be back for regular blogging later this week.

6 thoughts on “VBA to JavaScript Translator

  1. Ghazanfar J

    Good idea, this will certainly become more relevant sometime in the near future. But I don’t know how powerful Javascript would be for serious Office automation. Vba isn’t perfect but it still gets a lot of things done. The automation Google Apps Script adds to Google Sheets is intriguing but not reliable.

  2. 0live

    a[0]=a[0].replace(/function\s+/i,””);

    Array
    0 “B = 5;”
    1 “for(A=1; A<=10; A++){"
    2 "A*B;"
    3 "}"
    4 "if(B !=50 || B == A ){"
    5 "alert(0);"
    6 "}else{"
    7 "B = 20;"
    8 "}"
    length 9

  3. Don Anderson

    Anyone have ideas of how to deploy a VB rich Excel template or worksheet via a browser interface?

  4. Eric

    You wrote this about a year ago and now I need it…
    You are truly a predictor of the future…
    Got a favorite team for next years super bowl? I would like to make a few bucks.

Leave a Reply

Your email address will not be published. Required fields are marked *