Link to home
Start Free TrialLog in
Avatar of CRX4LIFE18
CRX4LIFE18

asked on

Microsoft JScript runtime error: Automation server can't create object

I'm trying to create an activeXObject  in javascript which works on my local machine just running the .htm file, but when I try to run it in Visual Web Developer 2005 I get the following error:
Microsoft JScript runtime error: Automation server can't create object

I also get a similar error running it on a corporate IIS6.0 server. I updated the Windows script to 5.6, played around with lots of settings but can't get it to work. I've googled this for two daty and have come up empty. Any ideas?

Thanks,
Matt

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Test</title>
    
   
<script type="text/javascript">
<!--
 
         DEVICE=new ActiveXObject("Object"); //<---Error
 
</script>
 
</head>
<body>
 
</body>
</html>

Open in new window

Avatar of Zvonko
Zvonko
Flag of North Macedonia image

You CANNOT create objects for "Objects" that are not installed at the machine where the script is executed.

What is the string content for your "Object"?

Avatar of CRX4LIFE18
CRX4LIFE18

ASKER

The string content is:

var DEVICE=new ActiveXObject("HardwareDevice.API");

The code works correctly on the machine where the .dll is registered when I run the code in the .htm file, but when I try to start the project in Visual Web Developer or on a production server it gives me the error. I also tried registering the .dll on the web server the code was being run on (even though I know it shouldn't have to be) and still didn't work.
ASKER CERTIFIED SOLUTION
Avatar of CRX4LIFE18
CRX4LIFE18

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi all,
       I also face some like problem, basicalli i create a html page, when i run this page locallu it is working bute when i  host the page in IIS , the page is not working proparly and get error "AOTOMETION SERVER CAN;T CREATE OBJECT" and don;t show any result.
what can i do? helpse help me!!

code is mention below:-
"Computer Name:
<input name="Computer Name" type="text" readonly="readonly">           
               <script type="text/javascript" language="javascript">
                  var ax = new ActiveXObject("WScript.Network");
                  //document.write(ax.UserName + '<br />');
                  document.getElementById("User Name").value = ax.UserName;

                  </script>
            <br>
            
                  <script type="text/javascript" language="javascript">
                  var ax = new ActiveXObject("WScript.Network");
                  //alert(ax.ComputerName);
                  document.getElementById("Computer Name").value = ax.ComputerName;
                  //alert(document.getElementById("txtUsrName").value);
                  //document.write(ax.ComputerName + '<br />');
                  
            </script>"
Please open a new question for your problems.