07-24-2023, 03:36 AM
I'm using JScript in Excel VBA via scriptcontrol. In 32bit this is simply the following;
Dim Script As Object
Set Script = CreateObject("ScriptControl")
Script.Language = "JScript"
In 64bit this natively doesn't work, as Windows/Office 64bit doesn't support ScriptControl. I use Tablacus' Scriptcontrol for 64bit as a solution, and while this generally works great, it doesn't seem to support the Jscript function "getObject" (setting it up is the same as above, as Tablacus just gives a dll reference to support scriptcontrol).
In 32 bit, the following works fine:
Script.Eval "var Workbook = GetObject('', 'Microsoft.Excel').Workbooks('MyMagicWorkbook.xls')"
In 64 bit, it gives me "GetObject is undefined" - I have listed it as an issue on the Tablacus' support page, but in the meantime am wondering if there is an alternative to 'GetObject' that I could use to refer to an excel workbook from Jscript?
Dim Script As Object
Set Script = CreateObject("ScriptControl")
Script.Language = "JScript"
In 64bit this natively doesn't work, as Windows/Office 64bit doesn't support ScriptControl. I use Tablacus' Scriptcontrol for 64bit as a solution, and while this generally works great, it doesn't seem to support the Jscript function "getObject" (setting it up is the same as above, as Tablacus just gives a dll reference to support scriptcontrol).
In 32 bit, the following works fine:
Script.Eval "var Workbook = GetObject('', 'Microsoft.Excel').Workbooks('MyMagicWorkbook.xls')"
In 64 bit, it gives me "GetObject is undefined" - I have listed it as an issue on the Tablacus' support page, but in the meantime am wondering if there is an alternative to 'GetObject' that I could use to refer to an excel workbook from Jscript?