Book a Demo

Author Topic: ActiveXObject is not defined  (Read 10940 times)

Erik Holleboom

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
ActiveXObject is not defined
« on: September 25, 2015, 09:04:50 pm »
Hi,

I try to instantiate an active X object like Word....

But I seem to get stuck on ActiveXObject is not defined?

I cannot find out what to do to make this possible. I see many examples doing it, but what needs to be enabled(option or simething alike) or present (tool)?


Erik Holleboom

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: ActiveXObject is not defined
« Reply #1 on: September 25, 2015, 09:10:40 pm »
After changing  from javascript script to jscript it worked.

Apparently there is some security difference

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13455
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ActiveXObject is not defined
« Reply #2 on: September 25, 2015, 10:35:26 pm »
Its a syntax difference, not a security difference. There another syntax you need to use for JavaScript. Check the examples in the EAScriptLib MDG for examples in all three languages.

Geert

JDT

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • It never hurts to help - [Eek the Cat]
    • View Profile
Re: ActiveXObject is not defined
« Reply #3 on: February 14, 2020, 01:24:04 am »
Instead of this (JScript):

Code: [Select]
var xmlDOM = new ActiveXObject("MSXML2.DOMDocument.6.0");
try this (JavaScript) instead:

Code: [Select]
var xmlDOM = new COMObject("MSXML2.DOMDocument.6.0");
That should work.