0
  • shortly:

the code CATIA.SystemService.ExecuteScript(sPath, 0, sName + ".CATScript", "CATMain", aParams) ; throw error Type mismatch, and i don't understand since in IE11 (I know, but I have to) debugger, the watch of CATIA.SystemService gives me the same list of argument for method ExecuteScript, and this call is working in VBscript. How can i get details on argument types? how can I know which var is causing this error? All my variables are declared (use strict).

  • in details:

I'm trying to figure out how to save a large set of functions using HTML interfaces to run CATscripts (Catia macros, VBscript like), that are launched via VBscripts, from the transition of my Company from IE8 to IE11 (no choices here). As discussed there in MSDN, and here in Stackoverflow (I've tried all solutions obviously, and the compatibility setting is not activatable), VBscript support stops in IE11

I have 2 sort of functions: some are static, and stored on our intranet website. They still work on IE11 (Edge mode if i understood, although i couldn't find exactly what it mean)

But some other are written on the fly, on users computer, to generate an interface reflecting what's currently in Catia. Those don't work anymore on IE11, and are the most important. It seems they are considered "internet zone", which I don't understand since they are locally written. is that to prevent malware?

here is how i call the function from the HTML:

<input type='button' value='00-10' onclick='StartScript(me)' id='import-zip-from-DB'/>

and here is the VBscript (simplified but functional):

Sub StartScript(button)
    Dim aParams()
    Dim sName
    Dim sPath
    Dim CATIA
    sName = button.Id
    sPath = "C:\temp\"
    'Get Catia object
    Set CATIA = GetObject(, "CATIA.Application")
    'run the script in catia
    On Error Resume Next
    CATIA.SystemService.ExecuteScript sPath, 1, sName & ".CATScript", "CATMain", aParams
    If Err.Number <> 0 Then MsgBox Err.Description, vbCritical, "QC2 toolset"
    On Error GoTo 0
End Sub

I have tried Javascript, with a really similar function. the code to get Catia Object is var CATIA = new ActiveXObject("CATIA.Application");

thanks in advance!

Community
  • 1
  • 1
Rafiki
  • 604
  • 6
  • 19

1 Answers1

0

I found a solution, finally!

It's not my favourite answer, but renaming files from file.html to file.hta allowed my functions to work again on my user's stations, as the files are now openned by Microsoft HTML Application host. Major downside: CSS formatting is not as good as IE, but that's a minor issue on a professional tool

So if anyone has a solution that don't involve HTA files, that would surely replace this workaround on my toolset, but for now i'm relieved :)

Rafiki
  • 604
  • 6
  • 19