Code Monkey home page Code Monkey logo

vba-to-javascript-translator's Introduction

VBA-to-JavaScript-Translator

This translator is intended to be used as an educational tool to help VBA developers get familiar with JavaScript.

The code for this tool is based on regex examples found from multiple sources in forums and online. Sorry to say...I did not keep a record of all the sources I leveraged. Just know that people smarter than I am provided the basis for most of the code found here. I simply adjusted what I needed and slapped it all together into a single utility.

As with most translation tools, this tool will NOT perform a 100% complete translation. It is designed to cover common constructs in VBA (enough to get you started).

The idea is to enter a basic block of VBA code (be sure to include your Function/Sub wrappers) and see how the syntax would look in JavaScript. It's best if you first try something simple then progress into more advanced IF statements, loops, comparison operators, Select Case switches, etc.

Currently, this translator works with:

  • Both Functions and Sub Procedures
  • Variable Declarations
  • Basic IF THEN Statements
  • SELECT CASE Statements
  • Most Comparison Operators
  • Basic FOR x TO y Loops
  • Most variations of DO LOOPS
  • Basic MSGBOX calls

Known Issues: This tool currently does NOT accurately translate

  • Built in VBA functions
  • References to Office Objects
  • WITH Statements
  • STEP Constructs in FOR Loops
  • FOR EACH Loops (in fact these cause the tool to return nothing at all. I'm still working out why that is)

I offer the source code up to anyone interested in helping make enhancements to this tool in order to develop a more robust utility for the VBA community.

See working tool here: http://www.datapigtechnologies.com/VBAToJS/VBAToJavaScriptTranslator.html

vba-to-javascript-translator's People

Contributors

mha105 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.