Author Topic: Script error: “Automation server can't create object”  (Read 3930 times)

hano08

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Script error: “Automation server can't create object”
« on: November 03, 2020, 09:14:25 pm »
We are using some VBscripts that work as intended (for a long time). Now we're starting to see that these scripts do not work for some clients. The error msg is "EA Generic error: ActiveX component can´t create object: ‘MSXML2.DOMDocument.4.0’
What these clients (with script failing) have in common is that they are of a newer model and thus newly installed.
Trying to narrow the problem I have tested with the example JScript 'Example Template Fragment Script' (https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_publishing/example_rtf_template_fragment_.html)

On an older client, the script works, but on a new client the error msg is "Script error: ‘Automation server can't create object’ ”

If I change the line
Code: [Select]
var xmlDOM = new ActiveXObject("MSXML2.DOMDocument.4.0"); to
Code: [Select]
var xmlDOM = new ActiveXObject("MSXML2.DOMDocument.6.0");

it seems to work both on an older as well as a newer client.

I compared the msxml.dll's in \Windows\System32, and both "client types" have
msxml3.dll
msxml6.dll
with identical date stamp (2020-10-23) and version number.
So, what am I dealing with here?
Should I let the Infrastructure Dep. look for differences between the clients' setup, or should I let the scripts in EA change?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13416
  • Karma: +569/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Script error: “Automation server can't create object”
« Reply #1 on: November 03, 2020, 09:31:58 pm »
this might be relevant: https://stackoverflow.com/questions/16167111/activex-component-cant-create-object-msxml2-domdocument

I'm guessing the specific library that contains MSXML2.DOMDocument.4.0 is not installed on the new machines.

If you search the registry of the old machines for that string, you should be able to figure out which dll they are referring too (it might be location somewhere else then C:\Windows\System32)

Geert

hano08

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Script error: “Automation server can't create object”
« Reply #2 on: November 03, 2020, 11:28:16 pm »
Thanks Geert,
Yes, the differences in Registries confirms that.
I also installed msxml4.dll on one client with failed scripting, making it work again.

Seems like since all versions of MSXML 4.0 (including SP2 and SP3) are no longer supported, and will no longer receive security updates, I guess our Infrastructure Dept. won't distribute if I ask them to.

So, guess I need to change the scripts.

/Hans