JavaScript runtime error: Automation server can’t create object

In this post we will discuss how we can resolve “JavaScript runtime error: Automation server can’t create object” which comes when we try to use ActiveXObject with JavaScript in Asp.Net.

Also, you can check out some posts on:

– Lock users who provide bad passwords in Asp.Net

– Get stored procedure source text in sql server 2008

– Jagged arrays in C#.Net

Recently I got this error while trying to use ActiveXObject through JavaScript.

I was trying to call like below:

<script type=”text/jscript”>

function GetDongleDetails() {

var x = new ActiveXObject(‘AxControls.HelloWorld’);

var count = x.GetText();

};

</script>

And I was getting the error in the below line:

 var x = new ActiveXObject(‘AxControls.HelloWorld’);

I remembered I have reset my IE setting one day back.

Solution:

We need to enable some security options in IE settings.

Go to Tools -> Internet Options -> Then select Security tab and then Click on Custom Level button.

Here we need to enable the below options:

– Run ActiveX controls and plug-ins


–  Initialize and script ActiveX controls not marked as safe for scripting.

After this, the error should not come.


You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply