Those of you that read this blog, and the ramblings site, will know that the topic content is about equally split between VBA and javaScript.
Until today, I had no idea that there was a scripting object that could be used from VBA, but would allow you to write your code in JScript. The ScriptControl object allows you to do that.
Consider this (you’ll need to add a reference to scriptControl v1.0 in the VBE)
Public Sub x() Dim o As New ScriptControl o.Language = "JScript" With o .AddCode "function x(a,b) {return 'the answer is:' +(a+b);}" Debug.Print .Run("x", 1, 2) End With End Sub
the answer is:3
… you will see more about this in future posts as I dig into how far this can be pushed.
Maybe here..
http://www.microsoft.com/download/en/details.aspx?id=1949