|
Harbs. wrote:
FWIW, to return a value from VB using doScript, you need returnValue = SomeValue at the end of your VB script.
|
I know that's the case with a Sub or a Function...is that how it works at the end of a script as well?
|
Harbs. wrote:
Did you try GetObject()? |
Interesting. Hadn't heard of that before. I can't quite tell how it would apply from the documentation so far.
|
Justin Putney wrote:
Harbs. wrote:
FWIW, to return a value from VB using doScript, you need returnValue = SomeValue at the end of your VB script.
I know that's the case with a Sub or a Function...is that how it works at the end of a script as well?
|
To answer your questions, here's a working snippet I have which gets the current file from Excel:
var vbs = 'Set MyXL = GetObject(, "Excel.Application")\r' +
'Set ActiveXL = MyXL.activeworkbook\r'+
'returnValue = ActiveXL.Path';
var path = app.doScript(vbs,ScriptLanguage.VISUAL_BASIC);