0

To manually enable Active Scripting in IE:

"The following should enable scripting in Internet Explorer:

1.On the Tools menu, click Internet Options, and then click the Security tab.

2.Click the Internet zone.

3.Click Custom Level.

4.In the Security Settings – Internet Zone dialog box, click Enable for Active Scripting in the Scripting section."

Is there a way to programmatically detect if this is enabled utilizing javascript?

codr
  • 889
  • 3
  • 13
  • 22
  • Well, if you write some JS and it works, then Active Scripting is enabled. If you write some JS and it doesn't work, then it's not enabled. You can't test for the setting being turned on using JS as JS is disabled if it's not enabled... – Rory McCrossan Oct 03 '17 at 16:32

1 Answers1

0

From just playing around in IE/Chrome looks like both throw a helpful exception when trying to use ActiveX

try{
     var excelApp = new ActiveXObject("Excel.Application")
     /* working continue */
}catch(e){
    if(e.message === "ActiveXObject is not defined"){
        //unsuported browser
    }else if(e.message === "Automation Server Can't Create Object"){
        /* security settings not setup correctly
           enable Active scripting and add site to trusted list */
    }
}

refrence for solving "Automation Server Can't Create Object"

I concur with the sentiment given in that posts answer:

Personally I would avoid ActiveX like the plague since it is locking you into the IE only world. Hence why we still have people stuck with IE6.